- 03 Mar, 2015 8 commits
-
-
Jim Meyering authored
Summary: This avoids warnings about e.g., sizeof(k++) that result from macro expansion. * folly/futures/test/ExecutorTest.cpp: Move increment out of macro argument list. * folly/test/FBVectorTestBenchmarks.cpp.h: Likewise. * folly/test/LazyTest.cpp: Likewise. Otherwise, we'd get errors like this: folly/test/LazyTest.cpp:49:118: error: expression with side effects has no effect in an unevaluated context [-Werror,-Wunevaluated-expression] switch (0) case 0: default: if (const ::testing::AssertionResult gtest_ar = (::testing::internal:: EqHelper<(sizeof(::testing::internal::IsNullLiteralHelper(++globalCount())) == 1)>::Compare("++globalCount()", "1", ++globalCount(), 1))) ; else ::testing::internal::AssertHelper(::testing::TestPartResult::kNonFatalFailure, "folly/test/LazyTest.cpp", 49, gtest_ar.failure_message()) = ::testing::Message(); ^ Test Plan: Run these commands and note there are fewer errors than before: fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo Reviewed By: njormrod@fb.com Subscribers: folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1848324 Tasks: 6244745 Signature: t1:1848324:1423860890:bce44c5e0895804a21957893ae6b78e76dfbc4d3
-
Jim Meyering authored
Summary: Upgrading to clang:dev (clang >3.6) brought in some new warnings. This change address all of the issues exposed by the new -Winconsistent-missing-override, usually by simply adding the missing "override" keyword. However, in folly/wangle/channel/test/MockChannelHandler.h, I chose to ignore those warnings for the mocked functions. * folly/futures/test/ViaTest.cpp: Add missing "override"(s). * folly/io/async/AsyncSSLSocket.h: Likewise. * folly/io/async/AsyncSocket.h: Likewise. * folly/io/async/EventBase.h: Likewise. * folly/test/ExceptionWrapperTest.cpp: Likewise. * folly/wangle/channel/AsyncSocketHandler.h: Likewise. * folly/wangle/channel/test/MockChannelHandler.h: Ignore the new warning for these functions. Test Plan: Run these commands and note there are fewer errors than before: fbconfig --clang --with-project-version=clang:dev -r folly && fbmake dbgo Reviewed By: hans@fb.com Subscribers: trunkagent, fugalh, folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1848330 Tasks: 6244745 Signature: t1:1848330:1423858909:b167ca220d6c9fe036d3adca08cf3053a7a9de16
-
Hannes Roth authored
Summary: This seems cleaner. I also moved a Core member around and changed state to be a smaller size to save us 16 bytes. Might be neat to try to get this down to 128? Fixed compilation with GCC 4.9, too. Test Plan: Ran all the tests. Will also benchmark. Reviewed By: hans@fb.com Subscribers: trunkagent, folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1843129 Signature: t1:1843129:1423789502:60e56d1af553994991195fcc350d37d644a556ca
-
Jonathan Frank authored
Summary: Pass TransportInfo object through connection setup. This allows us to pass along additional info from the setup if necessary. Test Plan: Run proxygen on my devserver listening on ipv4 and ipv6 for ports 80 and 443. Configure it to run a lua request rule with the following lines: io.stderr:write("jonlog: proxy " .. conn:getClientAddrOriginal() .. "\n") io.stderr:write("jonlog: client " .. request:getClientIPStr() .. "\n") Run haproxy also on my devserver, listening on ports 8555-8558, with each forwarding to one of the four pairs (ipv4-localhost/ipv6-localhost, 80/443) From my laptop, run curls against each of these four endpoints and make sure that we print out "127.0.0.1" as the proxy IP, and my laptop's IP as the client IP. Reviewed By: cgheorghe@fb.com Subscribers: jsedgwick, yfeldblum, trunkagent, ruibalp, bmatheny, folly-diffs@, dsp, nbm FB internal diff: D1746590 Tasks: 5688127 Signature: t1:1746590:1423695880:f647964d95636a69a00304e144aef71ee0213d28
-
Giuseppe Ottaviano authored
Summary: `EliasFanoReader::position()` used to return `size() - 1` both when the reader is positioned on the last element, and after `next()` is called after that (and it return `false`). Now in the latter case `position()` returns `size()` (consistently with the usual behaviour of past-the-end iterators). Also fix the return type of `jumpTo`. Test Plan: fbconfig folly/experimental/test:eliasfano_test && fbmake runtests_opt Reviewed By: philipp@fb.com Subscribers: trunkagent, folly-diffs@, yfeldblum FB internal diff: D1846275 Signature: t1:1846275:1423790264:151f5d2e1e09d4e24dfb758473dfb9cd52c070bd
-
Keith Adams authored
Summary: A colleague at another company started making fun of MicroSpinLock for its x86 assembly and ad hoc compiler memory barriers. Use C++11 (which wasn't really a thing at the time I wrote this). Test Plan: folly's runtests. What else would we like? Reviewed By: andrei.alexandrescu@fb.com Subscribers: folly-diffs@, yfeldblum FB internal diff: D1841563 Signature: t1:1841563:1423780458:a447c081fbd72e3420b23e95dcf26575c9a06798
-
Giuseppe Ottaviano authored
Summary: Short skips have been optimized by adding special cases that use simple iteration when it is convenient. Large skips have been optimized by using the broadword selection algorithm by Vigna (improved with ideas by Gog&Petri) instead of iterating on the zeros/ones of the upper bits. The benchmarks had to be made more granular to measure the differences, in particular they used to test skipping with a fixed skip length for each test, while now we average over a range of skips to better simulate a random distribution. The improvements are very significant for `skipTo()` on short skips, about 2-3x for skips at distance 1 or 2, which can occur when intersecting dense lists. On large skips the gain is about 17%. `skip()` exhibits slightly smaller improvements. before after ============================================================================ ================== folly/experimental/test/EliasFanoCodingTest.cpp relative time/iter iters/s time/iter iters/s ============================================================================ ================== Next 2.52ns 396.26M 2.52ns 397.28M Skip_ForwardQ128(1) 8.66ns 115.52M 3.92ns 255.28M Skip_ForwardQ128(2) 8.37ns 119.42M 5.08ns 197.04M Skip_ForwardQ128(4_pm_1) 9.67ns 103.41M 7.04ns 142.02M Skip_ForwardQ128(16_pm_4) 21.44ns 46.65M 19.68ns 50.82M Skip_ForwardQ128(64_pm_16) 30.86ns 32.40M 27.58ns 36.26M Skip_ForwardQ128(256_pm_64) 37.80ns 26.45M 32.49ns 30.78M Skip_ForwardQ128(1024_pm_256) 38.99ns 25.65M 33.39ns 29.95M Jump_ForwardQ128 37.91ns 26.37M 34.05ns 29.37M ---------------------------------------------------------------------------- ------------------ SkipTo_SkipQ128(1) 13.87ns 72.10M 4.42ns 226.49M SkipTo_SkipQ128(2) 18.80ns 53.20M 8.58ns 116.55M SkipTo_SkipQ128(4_pm_1) 23.59ns 42.38M 11.43ns 87.50M SkipTo_SkipQ128(16_pm_4) 36.04ns 27.74M 31.19ns 32.06M SkipTo_SkipQ128(64_pm_16) 53.34ns 18.75M 43.88ns 22.79M SkipTo_SkipQ128(256_pm_64) 62.27ns 16.06M 49.08ns 20.37M SkipTo_SkipQ128(1024_pm_256) 65.63ns 15.24M 52.24ns 19.14M JumpTo_SkipQ128 65.89ns 15.18M 54.61ns 18.31M ---------------------------------------------------------------------------- ------------------ Encode_10 111.94ns 8.93M 117.24ns 8.53M Encode 5.35ms 187.02 5.64ms 177.15 ---------------------------------------------------------------------------- ------------------ Select64 8.07ns 123.96M 8.04ns 124.35M ============================================================================ ================== Test Plan: fbconfig folly/experimental/test:eliasfano_test && fbmake runtests_opt Reviewed By: philipp@fb.com Subscribers: yfeldblum, fbcode-common-diffs@, chaoyc, search-fbcode-diffs@, unicorn-diffs@, trunkagent, folly-diffs@ FB internal diff: D1793554 Signature: t1:1793554:1423619344:1b078c0789639f317342ebcc77b11fe91859cd7b
-
Hannes Roth authored
Summary: Saw this while debugging some stuff. Just an oversight, right? Test Plan: Ran all the tests. Reviewed By: hans@fb.com Subscribers: folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1843016 Signature: t1:1843016:1423704557:d9fdb4b879ab4fcfda54a5fcb16a639df15872b5
-
- 12 Feb, 2015 5 commits
-
-
Sara Golemon authored
-
Tom Jackson authored
Summary: That is, for all inputs except r-values. Now with support for GCC. Test Plan: Run tests Reviewed By: ajaymenon@fb.com Subscribers: moharrami, trunkagent, folly-diffs@, yfeldblum FB internal diff: D1822339 Signature: t1:1822339:1423683482:027871549d69017a7a23a675025851a0b876ad77
-
Sara Golemon authored
Summary: This was recently added by @andrii to provide stack traces, but it no longer needed since he now produces them from a hook in folly/experimental/SingletonStackTrace.cpp Test Plan: Continues to build without the include. Reviewed By: andrii@fb.com Subscribers: folly-diffs@, yfeldblum, andrii FB internal diff: D1842654 Signature: t1:1842654:1423696133:cfa91851f28696082f790eb13c3b0b015c813590
-
Nathan Bronson authored
Summary: This reverts commit 4ebb2303bbcf343d7c2bcc95d55557c0a3b444f3. The caching mechanism was based on a misunderstanding of the implementation of CLOCK_MONOTONIC_COARSE, and is not correct. On the plus side, the upstream kernel patch e76b027e6408 x86,vdso: Use LSL unconditionally for vgetcpu gets the vdso getcpu from 16 nanos down to 10 (half of which is the inherent indirect call). Test Plan: unit tests Reviewed By: delong.j@fb.com Subscribers: trunkagent, bmaurer, tudorb, folly-diffs@, yfeldblum, jdelong FB internal diff: D1840690 Signature: t1:1840690:1423693026:33801341ec0b83bf47e050be6528c5dd05021ed5
-
Andrii Grynenko authored
Summary: Open-source build was broken because Symbolizer is not part of it. Test Plan: singleton unit test w/ and w/o SingletonStackTrace.cpp linked in. Reviewed By: alikhtarov@fb.com Subscribers: trunkagent, folly-diffs@, yfeldblum FB internal diff: D1840346 Signature: t1:1840346:1423690004:926c2aa21e0b7916260749120997ad56fab6f742
-
- 11 Feb, 2015 25 commits
-
-
Sara Golemon authored
-
Sara Golemon authored
Summary: This is usually available on linux Test Plan: Existing tests and manual test on arclinux Reviewed By: mpawlowski@fb.com Subscribers: folly-diffs@, yfeldblum FB internal diff: D1840081 Signature: t1:1840081:1423619986:911c95f9f04f286e9f113543ab4b705cf1b17396
-
Ranjeeth Dasineni authored
Summary: removing // as it could break some comment parser Test Plan: unitz Reviewed By: dancol@fb.com Subscribers: trunkagent, doug, seanc, folly-diffs@, yfeldblum FB internal diff: D1830591 Signature: t1:1830591:1423203436:9e8b28b714eb2dc080462ab3e8ce04c176df8586
-
Hans Fugal authored
Summary: I have half a mind to just rip this out and let people use std::bind if they need this. But I won't be so cruel. Why isn't this just implemented as `then(std::bind(method, object))` anyway? Is the template soup we have now faster? Test Plan: Fixed the unit tests to use the new format. Will look to contbuild to catch all the things this might break (if anyone is using it at all?), and will fix them. Reviewed By: hannesr@fb.com Subscribers: trunkagent, exa, folly-diffs@, yfeldblum, jsedgwick, davejwatson FB internal diff: D1831118 Signature: t1:1831118:1423243771:65db9a89daf14d8bd88331c503ba1ea7ab03b679
-
Hans Fugal authored
Summary: `futures::chain<A,Z>(a, b, c, d, e, f, ..., z)` where `a` is a callback suitable for `Future<A>::then` and `z` is a callback suitable for `Future<Y>::then<Z>`. This will be important, at least in the background, for the new `via`. It will probably also be useful to some user sometime. I imagine this will be tweaked over time if people find magic ways to get it to deduce the types better. But this works and it's not *too* much trouble to specify A and Z. Test Plan: unit Reviewed By: davejwatson@fb.com Subscribers: trunkagent, exa, folly-diffs@, yfeldblum, jsedgwick FB internal diff: D1831073 Tasks: 6048744 Signature: t1:1831073:1423259292:711be0e047a2acb706fd74e529d5d5fb6abda566
-
Andrii Grynenko authored
Summary: This adds different types of messages depending on whether Singleton was depending on other Singleton or just leaked. It also adds destruction stack trace for such Singletons (if they were ever destroyed) to help debug such leaks/broken dependencies. Test Plan: unit test Reviewed By: chip@fb.com Subscribers: trunkagent, folly-diffs@, yfeldblum FB internal diff: D1830526 Signature: t1:1830526:1423266462:ba328b0da0bf4030b1c4f686d8f7b609fd20683c
-
Andrii Grynenko authored
Summary: Most of the singleton construction logic is moved to SingletonEntry, and each SingletonEntry is now also a singleton. SingletonVault becomes only responsible for keeping singleton construction order (and potentially dependencies) and destoying them in correct order. This also significantly improves perf of get() / get_weak() (not-fast) This diff is based on D1823663. Test Plan: unit test ============================================================================ folly/experimental/test/SingletonTest.cpp relative time/iter iters/s ============================================================================ NormalSingleton 333.35ps 3.00G MeyersSingleton 99.99% 333.39ps 3.00G FollySingletonSlow 49.99% 666.84ps 1.50G FollySingletonFast 95.90% 347.61ps 2.88G FollySingletonFastWeak 2.22% 15.00ns 66.66M ============================================================================ Reviewed By: chip@fb.com Subscribers: trunkagent, folly-diffs@, yfeldblum FB internal diff: D1827390 Signature: t1:1827390:1423268514:da322d1dcaba54905d478b253f26dd76f890fb4e
-
Philip Pronin authored
Summary: `decodeVarint` now accepts all of `StringPiece`, `MutableStringPiece`, `ByteRange`, and `MutableByteRange`. Test Plan: fbconfig -r folly unicorn/utils && fbmake runtests_opt -j32 Reviewed By: ott@fb.com, lucian@fb.com Subscribers: trunkagent, chaoyc, search-fbcode-diffs@, unicorn-diffs@, folly-diffs@, yzhan, yfeldblum FB internal diff: D1836805 Signature: t1:1836805:1423534085:cca5c3e83ad699e5d56e1d1e3394644ec3f94dab
-
Andre Pinto authored
Summary: Correct typo on docs. Test Plan: N/A Reviewed By: alikhtarov@fb.com Subscribers: folly-diffs@, yfeldblum FB internal diff: D1836264 Signature: t1:1836264:1423527402:4e5f263f446346f7145c33c671f0b9e694db15fd
-
Marcin Pawlowski authored
Summary: include was missing, causing build to fail on Arch Linux with gcc 4.9.2 -- found this while resolving other issues. Test Plan: build folly on my personal linux and on dev server Reviewed By: viswanath@fb.com Subscribers: fugalh, folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1835143 Signature: t1:1835143:1423513128:5dcff69a82878f47b40512711ed254f239399c2c
-
Andrii Grynenko authored
Summary: This reverts commit 4893c09795ad4b1187518b184ac4812079039988. Fix unit test in D1823663. Test Plan: fbconfig -r folly fbmake dbg Reviewed By: alikhtarov@fb.com Subscribers: folly-diffs@, yfeldblum FB internal diff: D1832645 Signature: t1:1832645:1423267466:6012f1d7700d540c7290c29b01b33148cf91183c
-
Nathan Bronson authored
Summary: Under Linux the process gtod doesn't contain the current cpu, so __vdso_getcpu uses RDTSCP, which makes it cost about 20 nanos. The gtod _does_, however, contain a nanosecond time (for CLOCK_REALTIME_COARSE) updated during context switches. This diff adds a TLS cache that uses __vdso_clock_gettime_ns(CLOCK_REALTIME_COARSE) to detect context switches. The end result is that AccessSpreader goes from ~20 nanos to ~6. Test Plan: unit tests Reviewed By: davejwatson@fb.com Subscribers: yfeldblum, trunkagent, folly-diffs@ FB internal diff: D1798922 Signature: t1:1798922:1423264298:32312a5e9bddb3b8aa630c146ef708164a6a4651
-
Nicholas Ormrod authored
Summary: This reverts commit 315cfed207895455ecd359d0c1b9d98f28ed0519. Test Plan: fbconfig -r folly && fbmake dbg Reviewed By: robbert@fb.com Subscribers: sdwilsh, folly-diffs@, yfeldblum FB internal diff: D1831932 Signature: t1:1831932:1423258329:0962b939a93bbf1722a9e1c90090dcc024b63765 Blame Revision: D1823663
-
Yedidya Feldblum authored
Summary: [Folly] Dedupe the implementations of EventBase::runInEventBaseThreadAndWait. Test Plan: Unit tests: * `folly/io/async/test/EventBaseTest.cpp` Reviewed By: subodh@fb.com Subscribers: trunkagent, folly-diffs@, yfeldblum, dougw, brettp FB internal diff: D1826291 Signature: t1:1826291:1423225534:42264d8dcc8adec6b90ac8a3d6ce1f4b98f29297 Blame Revision: D1810764, D1823407
-
Andrii Grynenko authored
Summary: This makes test SingletonVaults more similar to global SingletonVault. It also ensures that every SingletonVault is a singleton, which allows potential optimization of making each SingletonEntry a Singleton too, which itself will make get/get_weak as efficient as get_fast/get_weak_fast. Test Plan: unit test Reviewed By: chip@fb.com Subscribers: folly-diffs@, yfeldblum FB internal diff: D1823663 Signature: t1:1823663:1423188884:4ab2b47cfba270a66613f6f2458b6affc0ed96ad
-
Hans Fugal authored
Summary: we still make the new Future, but assign it to ourselves. this avoids the following buggy pattern that people might expect to work ``` auto f = ... f.wait(); // Careful. f.value() was moved out into the new Future, so you may have lost something someOperationOn(f.value()); // Nope. We already set a callback internally in wait() f.then(...); ``` Test Plan: unit Reviewed By: davejwatson@fb.com Subscribers: exa, yfeldblum, trunkagent, fbcode-common-diffs@, sammerat, cold-storage-diffs@, folly-diffs@, jsedgwick, aflock FB internal diff: D1809040 Tasks: 6048284 Signature: t1:1809040:1422900812:1b416408eb5eaa71e88778c9c22ed8bfba087efe
-
Andrei Alexandrescu authored
Summary: We're using StringKeyed* from common/datastruct to avoid unnecessary string creation whenever we're looking up string keys. C++14 does offer a solution, see e.g. http://stackoverflow.com/questions/10536788/avoiding-key-construction-for-stdmapfind. That is not supported by current compilers. Test Plan: unittests Reviewed By: pavlo@fb.com Subscribers: trunkagent, net-systems@, folly-diffs@, yfeldblum FB internal diff: D1825700 Signature: t1:1825700:1423086724:530550c3c80e33c80900f31c0ade05c66b22cbe8
-
Andrei Alexandrescu authored
Summary: Before this diff the code below compiled and did absolutely nothing of interest: StringPiece fun(); ... fun() = "hello"; i.e. assignment to an rvalue range was allowed. Such code is almost always, if not always, in error. This diff fixes that. Test Plan: ran unittests Reviewed By: ldbrandy@fb.com Subscribers: mpawlowski, net-systems@, folly-diffs@, yfeldblum FB internal diff: D1825360 Signature: t1:1825360:1423097817:fdaaf893cd1abbe71dc857a315df7c45cb6a0bd0
-
Darren Mo authored
Summary: Eliminated a potential race condition by removing unnecessary code. Test Plan: Unit tests pass. Reviewed By: lesha@fb.com Subscribers: tudorb, trunkagent, folly-diffs@, yfeldblum FB internal diff: D1824924 Signature: t1:1824924:1423102017:6bce388dccf9126d6ac3a1741d8300a51c5276ed Blame Revision: D1492526
-
Yedidya Feldblum authored
Summary: [Folly] Avoid EventBase depending on Baton (mutex/condvar variant). Test Plan: Unit tests: * folly/io/async/test/EventBaseTest.cpp Reviewed By: subodh@fb.com Subscribers: trunkagent, fma, folly-diffs@, yfeldblum, dougw, brettp FB internal diff: D1823407 Signature: t1:1823407:1423088450:71ae1673ed8067103e2aaa1ac9b239eae9ebe9de Blame Revision: D1810764
-
Hans Fugal authored
Summary: It is true. Also, add a useful message about which thread this Future will complete in. Test Plan: it should still compile Reviewed By: davejwatson@fb.com Subscribers: trunkagent, exa, folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1819849 Tasks: 5705286, 6008465 Signature: t1:1819849:1423074012:79bf11c877eb2f061cb5d07f7ab45fa4cc4a894b
-
Hans Fugal authored
Summary: (or func returns Future<T>) Invoke and respond to a timeout with a callback, rather than using `within` and adding `onError` or `then` or something. Test Plan: new tests Reviewed By: davejwatson@fb.com Subscribers: jsedgwick, yfeldblum, trunkagent, fugalh, exa, folly-diffs@ FB internal diff: D1763174 Tasks: 4548494 Signature: t1:1763174:1423074062:05cec1dfb1110b31b599033949ebe0ee70dd0552
-
Hans Fugal authored
Summary: I don't know what this paragraph is even saying. It looks like copypasta Test Plan: still compiles or my uncle is a monkey Reviewed By: davejwatson@fb.com Subscribers: trunkagent, exa, folly-diffs@, jsedgwick, yfeldblum FB internal diff: D1819905 Tasks: 5705286 Signature: t1:1819905:1423074021:a095fe2a17d5698678a527b60c9384625df869fd
-
Tom Jackson authored
Summary: The `memchr()`-based `find_first_of()` behaves extremely badly when it's used in a loop and the input string doesn't contain all the needles. This was discovered when a reasonable line-breaking routine tried to use it to break lines by a mix of '\r' and '\n'. The entire remainder of the file was scanned each time a line was read. Before: ``` CountDelimsBase 1.26s 794.86m CountDelimsNoSSE 100.03% 1.26s 795.12m CountDelimsStd 40501.63% 3.11ms 321.93 CountDelimsMemchr 98.31% 1.28s 781.41m CountDelimsByteSet 23162.41% 5.43ms 184.11 ``` After: ``` CountDelimsBase 3.20ms 312.08 <-- Base impl no longer considers memchr CountDelimsNoSSE 102.37% 3.13ms 319.47 CountDelimsStd 103.19% 3.11ms 322.05 CountDelimsMemchr 0.25% 1.27s 788.39m CountDelimsByteSet 59.68% 5.37ms 186.27 ``` Test Plan: Benchmarks Reviewed By: njormrod@fb.com Subscribers: folly-diffs@, yfeldblum FB internal diff: D1823536 Signature: t1:1823536:1423081687:bb2ec8cdea477ee9b9c8d8ad2bfdecdc52657515
-
Sara Golemon authored
This reverts commit 462e13b1.
-
- 09 Feb, 2015 2 commits