- 23 Jun, 2020 1 commit
-
-
Giuseppe Ottaviano authored
Summary: F14 class member fields are often in headers, and often the default constructor is implicit. The current implementation unconditionally instantiates `reserve()`, which has non-negligible cost. By specializing the default constructor we can avoid that in the common case. Reviewed By: philippv, luciang Differential Revision: D22166465 fbshipit-source-id: d31ebc7f6ab71392d49a6722545f8df9027d034b
-
- 22 Jun, 2020 1 commit
-
-
Lukasz Piatkowski authored
Summary: As per https://github.com/actions/virtual-environments/issues/709 there started to be some issies with Ubuntu envs running out of space. This should fix it. Also our Cargo builds use a lot of space, changing them to be non-incremental and removing debug symbols keeps the build fast, but greatly reduces the disk space usage leaving us enough space on GitHub Actions virtual machines. Pull Request resolved: https://github.com/facebookexperimental/eden/pull/23 Reviewed By: farnz Differential Revision: D22160020 Pulled By: lukaspiatkowski fbshipit-source-id: c23393e310c15ebf5a18b80f0bb5f1f894d24849
-
- 21 Jun, 2020 2 commits
-
-
Dan Melnic authored
Summary: Try to fix the OSS build Reviewed By: yfeldblum Differential Revision: D22145695 fbshipit-source-id: a1290441b982f8df78ffa8dcd772f0c02c4535aa
-
Yedidya Feldblum authored
Summary: [Folly] Missing public base class for `unicode_error`. which should publicly inherit `std::runtime_error`. Reviewed By: Mizuchi Differential Revision: D22153547 fbshipit-source-id: 4c60e8e072f0fc9240d199b6d81c7e85c99eaf34
-
- 19 Jun, 2020 4 commits
-
-
Giuseppe Ottaviano authored
Summary: These optimizations were introduced in D1793554, mostly to mitigate the high cost of `select64`. We've had an efficient implementation of `select64` for Haswell for a while, and Haswell is more than 5 years old, so we can drop the optimization, which actually harms performance on modern microarchitectures. While on a real workload this shows significant benefits, the microbenchmarks for very small skips are degraded: ``` ============================================================================ ==================== folly/experimental/test/EliasFanoCodingTest.cpp relative time/iter iters/s time/iter iters/s ============================================================================ ==================== Next 2.58ns 388.22M 2.55ns 391.93M Skip_ForwardQ128(1) 4.81ns 207.72M 4.31ns 231.79M Skip_ForwardQ128(2) 5.96ns 167.75M 4.67ns 214.07M Skip_ForwardQ128(4_pm_1) 7.40ns 135.16M 4.87ns 205.29M Skip_ForwardQ128(16_pm_4) 8.20ns 121.97M 5.38ns 185.93M Skip_ForwardQ128(64_pm_16) 12.04ns 83.06M 8.97ns 111.51M Skip_ForwardQ128(256_pm_64) 16.84ns 59.39M 13.19ns 75.79M Skip_ForwardQ128(1024_pm_256) 17.67ns 56.61M 14.19ns 70.45M Jump_ForwardQ128 25.37ns 39.41M 25.47ns 39.26M ---------------------------------------------------------------------------- -------------------- SkipTo_SkipQ128(1) 7.27ns 137.59M 10.77ns 92.87M SkipTo_SkipQ128(2) 10.99ns 91.01M 14.39ns 69.51M SkipTo_SkipQ128(4_pm_1) 13.53ns 73.93M 16.15ns 61.90M SkipTo_SkipQ128(16_pm_4) 20.58ns 48.59M 17.72ns 56.45M SkipTo_SkipQ128(64_pm_16) 32.08ns 31.18M 31.16ns 32.09M SkipTo_SkipQ128(256_pm_64) 38.66ns 25.87M 38.22ns 26.16M SkipTo_SkipQ128(1024_pm_256) 42.32ns 23.63M 42.07ns 23.77M JumpTo_SkipQ128 47.95ns 20.86M 47.85ns 20.90M ---------------------------------------------------------------------------- -------------------- Encode_10 103.99ns 9.62M 104.89ns 9.53M Encode 7.60ms 131.53 7.55ms 132.46 ---------------------------------------------------------------------------- -------------------- defaultNumLowerBits 3.59ns 278.69M 3.61ns 276.97M slowDefaultNumLowerBits 10.88ns 91.90M 10.98ns 91.06M ============================================================================ ==================== ``` It is important to note however that these micro-benchmarks have very little variability in terms of effective skip distance for small skips, producing almost perfect branch prediction in the linear scan loop. In a real workload, the overhead of branch misprediction ends up being significant. Reviewed By: philippv Differential Revision: D22139846 fbshipit-source-id: 8df17a74aa57c92413709d9e11c60a77d5462422
-
Giuseppe Ottaviano authored
Summary: Without FDO Clang generates very suboptimal code, adding this hints brings it almost to parity with FDO-compiled code. Reviewed By: philippv, luciang Differential Revision: D22139847 fbshipit-source-id: 2cdaf383ca1afd21db1b7ad2aafb3d3c7ce335b0
-
Mikhail Shatalov authored
Summary: `folly::get_default()` returns a copy of shared_ptr that gets immediately discarded. The change avoids that. Reviewed By: yfeldblum Differential Revision: D22119215 fbshipit-source-id: 36aab580d7042d19b6b076cad20586697fbfa5e3
-
Matthieu Martin authored
Summary: Provide an Async wrapper for fibers::await, which blocks current task until promise is fulfilled. This isn't a build block that is used in very common scenario, so prefered to put it in its own file. Differential Revision: D22135318 fbshipit-source-id: 753dbefc4ac9a907f5b1f656f70291c88187b5e8
-
- 18 Jun, 2020 3 commits
-
-
Zhengxu Chen authored
Summary: Currently RequestContext::getRootidsFromAllThreads() can access StaticContext root ids concurrently with RequestContext::setRequestContext() without synchronization guards, which is not safe cross other platforms than x64 and also causing TSAN warnings when used in server contexts. Therefore we can make it std::atomic and access it with relaxed order. This won't affect performance in major platform like x64 since the loads/stores instructions will be the same. Also as a side effect this prevents RequestContext::StaticContext from generating copy/move constructor, so we remove an extra copy of root id in StaticContext in setRequestContext path. Reviewed By: yfeldblum Differential Revision: D22083558 fbshipit-source-id: ed70e394f1172b07ba00c15f05a370f84265785c
-
darionyaphet authored
Summary: Pull Request resolved: https://github.com/facebook/folly/pull/1386 Reviewed By: yfeldblum Differential Revision: D21992975 Pulled By: Orvid fbshipit-source-id: 7d52e3e9f8db899079263ef15e9f1bbfbedadc44
-
Michael Park authored
Summary: This macro has been deprecated and given that there are not that many uses, it seems relatively simple to remove it entirely. Reviewed By: yfeldblum, aary Differential Revision: D16904736 fbshipit-source-id: 56daffd480c586be2a5636b3ce20c6fe1d5ea018
-
- 17 Jun, 2020 8 commits
-
-
Andrii Grynenko authored
Reviewed By: yfeldblum Differential Revision: D22071829 fbshipit-source-id: c7f0e1bc5a4257731bafee09144c33c9fb474e10
-
Doug Rabson authored
Summary: The ValueType alias in the multiplex function is not used and caused a build failure when I tried to use it, possibly because we have some extra warnings enabled in our code. Reviewed By: lewissbaker Differential Revision: D21685780 fbshipit-source-id: 3235c6444a623d5f484f0849679b1497f9456fa9
-
Lukas Piatkowski authored
cargo_from_buck: add the patch section to Cargo workspace and allow workspace appending to existing manifest Summary: Two changes here: 1. The `[patch.crates-io]` section of `third-party/rust/Cargo.toml` is being now copied over to workspaces generated by autocargo for OSS and in the runtime generated Cargo.toml file for cargo-fbcode builds. Without that some projects could be buildable in Buck internally, but not externally on GitHub due to missing patches. 2. If a `[workspace]` Cargo.toml file is being generated and there is already a generated Cargo.toml file in the same directory then instead of overriding that file the `[workspace]` (and `[patch]`) sections are appended to that Cargo.toml file. Reviewed By: farnz Differential Revision: D22023144 fbshipit-source-id: dec54491c36c2ee0ab29eefb722b3eceaef6ffe1
-
Mark Santaniello authored
Summary: Adjust `CxxAllocatorAdaptor` such that it becomes default constructible. This makes `SysArenaAllocator` default constructible too, which makes it much easier to use. A default-constructed `SysArenaAllocator` is not useful at all. Any attempt to allocate just throws `std::bad_alloc`. But it makes it possible to at least compile code like this: ``` using MyAlloc = SysArenaAllocator<char>; struct Foo { Foo() = default; // BOOM Foo(MyAlloc &a) : v(a) {}; vector<int, MyAlloc> v; } ``` Reviewed By: yfeldblum Differential Revision: D21967640 fbshipit-source-id: 5b74c6db14d75364b374cad71d0069b17769e5d6
-
Sumeet Khullar authored
Differential Revision: D22027490 Original commit changeset: 964d9fa19ca9 fbshipit-source-id: 2c92ea47c64450cb031be4a6df3c3be4901500b7
-
Lewis Baker authored
Summary: On Linux platforms the folly::futexWait() functions are implemented using the futex() syscall, which requires passing a timeout parameter that specifies a an expiry time either in CLOCK_REALTIME or CLOCK_MONOTONIC. The futexWait() implementation currently assumes that the std::chrono::system_clock and std::chrono::steady_clock implementations are thin wrappers over these clock types and that we can directly convert the .time_since_epoch() values to a timespec value that we can pass to the futex() syscall. The Futex.clock_source test is checking this assumption about the implementation of the std::chrono clocks. Unfortunately, this assumption does not hold on recent libc++ implementations for Apple platforms, which now uses the CLOCK_UPTIME_RAW clock for the std::chrono::steady_clock implementation and so this test was failing on the Mac platforms. However, since we aren't actually relying on this assumption on platforms other than Linux, we can just disable this test for non-Linux platforms. Reviewed By: yfeldblum Differential Revision: D22075639 fbshipit-source-id: 229995ba7c01b52d1949ef5942774920876d0994
-
Andrii Grynenko authored
Summary: Thread fences are not supported by TSAN Reviewed By: yfeldblum Differential Revision: D22056483 fbshipit-source-id: dfe5b462656605f2e659302125e248b287037629
-
Matt Ma authored
Summary: Original commit changeset: 25d4049019e4 Base diff broke fboss build (using fbcode_builder) with the following error: /tmp/fbcode_builder_getdeps-ZrootZfboss2.gitZbuildZfbcode_builder-root/installed/folly/include/folly/init/Init.h:22:10: fatal error: folly/experimental/symbolizer/SymbolizerMode.h: No such file or directory #include <folly/experimental/symbolizer/SymbolizerMode.h> Revert this first to unblock fboss while I am investigating the failure. Reviewed By: shri-khare Differential Revision: D22077183 fbshipit-source-id: 8bafc0518df82c61922104b7d59ef5ee20fdd572
-
- 16 Jun, 2020 2 commits
-
-
Pranav Thulasiram Bhat authored
Summary: Move the tests for the async framework into the a test directory under folly/fibers/async/ Differential Revision: D22023986 fbshipit-source-id: c38aa2a63381c2aea1fd89a0cf2740ca028152c9
-
Yedidya Feldblum authored
Summary: [Folly] Add missing `#include <memory>` in `folly/memory/ReentrantAllocator.h`. Closes: https://github.com/facebook/folly/pull/1379. Reviewed By: Orvid Differential Revision: D22062251 fbshipit-source-id: 30e2f5aa2708048c478a298cf7e12a012ba59540
-
- 15 Jun, 2020 8 commits
-
-
Matt Ma authored
Summary: Fixed the missed initialization in InitOptions. Reviewed By: luciang Differential Revision: D22023637 fbshipit-source-id: 25d4049019e42708c98e5b589ed4838e2870d39b
-
Giuseppe Ottaviano authored
Summary: F14 class member fields are often in headers, and often the default constructor is implicit. The current implementation unconditionally instantiates `reserve()`, which has non-negligible cost. By specializing the default constructor we can avoid that in the common case. Reviewed By: philippv, luciang Differential Revision: D22027490 fbshipit-source-id: 964d9fa19ca92797bcb209e09959dc4706af39d4
-
Pranav Thulasiram Bhat authored
Summary: This diff implements a deduction guide for explicitly creating and returning Async objects in lambdas and functions with deduced return types. This saves the user from having to specify often lengthy return types when annotating such functions. Reviewed By: A5he Differential Revision: D21770141 fbshipit-source-id: f80898ef6eeadee7c5a7168aaae4031e224a0935
-
Pranav Thulasiram Bhat authored
Summary: This diff implements traits to aid in the development of templated functions accepting annotated functions. Reviewed By: yfeldblum, A5he Differential Revision: D21770066 fbshipit-source-id: 40ae340aeeb484c4f9769c13b5c9a92a97723801
-
Pranav Thulasiram Bhat authored
Summary: This diff implements `coro_wait`, an annotated helper to block on the execution of a coroutine. The goal here is to provide an easy way to migrate from fibers to coroutines. Reviewed By: A5he Differential Revision: D21978610 fbshipit-source-id: d59a222978d9db2963656312e71c7dcb2b9a11e9
-
Pranav Thulasiram Bhat authored
Summary: This diff adds `future_wait`, an annotated helper to run blocking `get` operations on futures. `future_wait` will help annotate functions (and their caller stack) that block on futures. For semifutures, deferred work is performed on fiber-main context, so there is no concern of bleeding fibers. Reviewed By: yfeldblum Differential Revision: D21965552 fbshipit-source-id: 79941c3b73c67d63d83dcdc778c62a0fc9051de3
-
Chad Austin authored
Summary: I think LZ4 was disabled accidentally in our rocksdb getdeps build in D21319896. Enable it again on macOS and Linux, because otherwise this breaks people with EdenFS mounts containing LZ4-compressed proxy hashes. Reviewed By: xavierd Differential Revision: D21990356 fbshipit-source-id: b9166c2992ae51f09de3fa9a4f114143aa008f43
-
Lewis Baker authored
Summary: Adds a helper utility called 'tag_invoke' for defining CPOs that dispatch to a call to an overload of the ADL-name 'tag_invoke()' that takes the CPO as the first argument instead of to a CPO-specific ADL-name. This makes it possible to build generic adapters, such as type-erasing adapters, that can forward through calls to all CPOs through to an underlying object. Adds FOLLY_DECLVAL(T) helper macro used in the implementation of some of the traits. Reviewed By: yfeldblum Differential Revision: D17867173 fbshipit-source-id: fadae6ec97498008a5238036b7310a1e0ae119a2
-
- 13 Jun, 2020 1 commit
-
-
Nathan Bronson authored
Summary: folly::Hash<Range<T>> uses SpookyHashV2::Hash64 (for integral T). On 32-bit platforms we need an explicit cast to avoid a narrowing warning when converting this to size_t. (Note: this ignores all push blocking failures!) Reviewed By: shixiao Differential Revision: D21491467 fbshipit-source-id: 1cbd05553c61b8dccb664ec4478cfb0b049dc5b5
-
- 12 Jun, 2020 4 commits
-
-
Lucian Grijincu authored
Differential Revision: D21918702 Original commit changeset: 3213e9536147 fbshipit-source-id: 4e9394b2026f0d6d74e668c7c72b3612a42770ea
-
Giuseppe Ottaviano authored
Summary: This header is widely included (via `Future.h`) and instantiations of `UnboundedQueue`'s methods are expensive, so outline them (note that the template methods will only be instantiated if used, so that's fine). Reviewed By: philippv Differential Revision: D22014083 fbshipit-source-id: b6a71c38c142917e9e0d86fbb64a88462382952a
-
Matt Ma authored
Summary: This would allow us have better stack trace with inline functions in signal handler output. Reviewed By: luciang Differential Revision: D21918702 fbshipit-source-id: 3213e9536147759a4e59f5b6f68d22d941d36c7f
-
Yedidya Feldblum authored
Summary: [Folly] Wrap `_r_debug` per platform, since the way to get it varies by platform. Reviewed By: ot, luciang Differential Revision: D22004737 fbshipit-source-id: 6f6a6163c9709da0a5042b807cdd88fcdf2e57eb
-
- 11 Jun, 2020 3 commits
-
-
Andrii Grynenko authored
Summary: Thread fences are not supported by TSAN Reviewed By: yfeldblum Differential Revision: D21989519 fbshipit-source-id: bb657c82a64abe025e8f4c030916c0cacc3c0b81
-
Derek Brown authored
Summary: The `collectSemiFuture` method doesn't exist. Use `collectAllSemiFuture` instead. Pull Request resolved: https://github.com/facebook/folly/pull/1385 Reviewed By: yfeldblum Differential Revision: D21991532 Pulled By: DerekTBrown fbshipit-source-id: 4ba3378fe34b7e6bb910f7045267fdbab87ebb14
-
Yedidya Feldblum authored
Summary: Original commit changeset: 8eb472ce50bf This breaks time measurement to include measuring the wait preceding handler/callback invocation. Reviewed By: w-o-o Differential Revision: D21986042 fbshipit-source-id: 42701b929878c3f56d736de5ca0417814c64fce1
-
- 10 Jun, 2020 1 commit
-
-
Pranav Thulasiram Bhat authored
Summary: Debug builds can be prone to stack overflows if they are configurated to use the same stack sizes as prod builds. This diff effectively doubles the stack size for debug builds to provide more buffer against overflows. Reviewed By: yfeldblum Differential Revision: D21913754 fbshipit-source-id: bd32cc4dd9c79a50be178e5d6d30804a83e60ee4
-
- 09 Jun, 2020 2 commits
-
-
Mohamad Gebai authored
Summary: Returns the previous/next power of two that are strictly smaller/greater than the parameter. Reviewed By: yfeldblum, Gownta Differential Revision: D21920224 fbshipit-source-id: be919063379e5b231cc69d743128fcaeb0ea9f39
-
Yedidya Feldblum authored
Summary: [Folly] Cut the FOR_EACH_KV macro, which may be replaced by a combination of range-for and structured bindings. Differential Revision: D21826182 fbshipit-source-id: ce4712afd3d0d7806eb1fca8c97009da117f982e
-