Hacker GitHub

← All repos

meta/folly

View on GitHub ↗ ★ 30,556 C++

An open-source C++ library developed and used at Facebook.

144 mentions on Hacker News by 90 people: 15 stories, 129 comments · first 2012-06-02 · latest 2026-01-14

Mentions per year 144 mentions · busiest year 2020 (16)
20082026
  1. …trials and look at the minimum observed time, which is when there will have been ~no interruptions. https://github.com/facebook/folly/blob/main/folly/docs/Bench...
  2. …Not saying those are precisely on point, though; just thought some of the ideas were similar. [0]: https://github.com/facebook/folly/blob/main/folly/docs/Poly.... [1]: https://github.com/microsoft/proxy
    comment by aw1621107 · 2025-12-19 · in Common Rust Lifetime Misconceptions
  3. …Folly's definition [1]. [0] https://community.intel.com/t5/Intel-Moderncode-for-Parallel... [1] https://github.com/facebook/folly/blob/d2e6fe65dfd6b30a9d504...
  4. …in C++ in a very similar way as Rust. E.g., APIs can take folly::Synchronized<T>::RLockedPtr: https://github.com/facebook/folly/blob/76f81836a2ccb6cd3bc7d...
  5. …mostly historical, though it's relatively common to use a 128 byte line size on x86, still. E.g., https://github.com/facebook/folly/blob/main/folly/lang/Align... (Sandy Bridge was a 2011 CPU). (Clang's impl of the std version of these…
  6. …every single time they need to do some basic things (like for example version upgrades). Example: https://github.com/facebook/folly/blob/main/build.sh
  7. https://github.com/facebook/folly/blob/main/folly/chrono/Har...
  8. …on escape-heavy strings. [1] https://source.chromium.org/chromium/_/chromium/v8/v8/+/5cbc... [2] https://github.com/facebook/folly/commit/2f0cabfb48b8a8df84f...
  9. Bingo. https://github.com/facebook/folly/commit/4d932ecc53c7a722671...
  10. …[3]: https://research.facebook.com/publications/hive-a-warehousin... [4]: https://github.com/facebook/folly/tree/main
  11. …some are better at certain workloads than the rest. DistributedMutex and SharedMutex come to mind ( https://github.com/facebook/folly/blob/main/folly/synchroniz... , https://github.com/facebook/folly/blob/main/folly/SharedMute... ) Just…
    comment by uvdn7 · 2024-10-02 · in The Fastest Mutexes
  12. …look at it? Wondering if there are any advantages. The api seems fairly similar to me at a glance. https://github.com/facebook/folly/tree/main/folly/experiment...
  13. …disprove your wrong assertions as opposed to providing references that justify your position: Folly https://github.com/facebook/folly : "It complements (as opposed to competing against) offerings such as Boost and of course std. In fact,…
  14. ▲ 1
    Folly: An open-source C++ library developed and used at Facebook
    story by tosh · 2024-07-24 · 0 comments
  15. …used to test its core synchronization primitives, but I don't think it's as sophisticated as loom. https://github.com/facebook/folly/blob/main/folly/test/Deter...
  16. Easily solved manually reserving exponentially. All my projects use some variation of this: https://github.com/facebook/folly/blob/9f125c94e10fd01f5567c... But I've burned myself on this a few times before.
    comment by mandarax8 · 2024-06-09 · in Compilers are too smart
  17. Modern hash table implementations use vector instructions for lookups: - Folly: https://github.com/facebook/folly/blob/main/folly/container/... - Abseil: https://abseil.io/about/design/swisstables
    comment by alexhutcheson · 2024-06-04 · in Intel's Lion Cove Architecture Preview
  18. Nope, given that it has a plugin architecture and in time it would have been everywhere. https://github.com/facebook/folly/commit/b1391e1c57be71c1e2a...
    comment by pajko · 2024-03-31 · in Ask HN: How bad is the xz hack?
  19. yes, like this one: https://github.com/facebook/folly/pull/2153
  20. …correct.) And if they don't need the 2nd load on Linux, I'm unclear on why they do it. [0]: https://github.com/facebook/folly/blob/main/folly/synchroniz... (This uses either mprotect to force a TLB flush in process-relevant CPUs, or the…
  21. …but uses some sort of SeqCst barrier between the store and the 2nd load (with acquire semantics): https://github.com/facebook/folly/blob/main/folly/synchroniz...
  22. folly provides functions to resize std::string & std::vector without initialization [0]. [0] https://github.com/facebook/folly/blob/3c8829785e3ce86cb821c...
  23. It is doable, `folly::Expected` supports that: https://github.com/facebook/folly/blob/main/folly/test/Expec...
  24. …With BMI2 you can also use the PDEP instruction to accelerate the final select on a 64-bit block: https://github.com/facebook/folly/blob/main/folly/experiment...
    comment by ot · 2023-07-02 · in A compressed indexable bitset
  25. …was a non-negotiable. [1] https://github.com/ot/ds2i/ [2] https://github.com/pisa-engine/pisa [3] https://github.com/facebook/folly/blob/main/folly/experiment...
    comment by ot · 2023-07-01 · in A compressed indexable bitset
  26. C++ with folly's SCOPE_EXIT {} construct: https://github.com/facebook/folly/blob/main/folly/ScopeGuard...
    comment by loeg · 2023-06-21 · in Defer for Shell (2020)
  27. …that read it very frequently (typical use case is configs). The most performant solutions are RCU ( https://github.com/facebook/folly/blob/main/folly/synchroniz... ) and hazard pointers ( https://github.com/facebook/folly/blob/main/folly/sy…
  28. …folly C++ library was something I'd point to for my junior engineers to get a sense of "good" C++ https://github.com/facebook/folly
  29. ▲ 1
    Growing std::vector by a factor that allows memory reuse (2020)
    story by nequo · 2023-05-06 · 0 comments
  30. …in the standard library this even spells out that the result has "at least the specified capacity" https://github.com/facebook/folly/blob/main/folly/container/... F14 is a linear map but I couldn't immediately find actual API…
    comment by tialaramex · 2023-04-12 · in Deduplicate a slice in Go, use sort or a map?
  31. …com/SerenityOS/serenity/blob/master/Kernel/Lo... I don't know why the article doesn't touch on these. https://github.com/facebook/folly/blob/main/folly/docs/Synch... https://github.com/facebook/folly/blob/main/folly/Synchroniz...
  32. …? https://en.cppreference.com/w/cpp/atomic/atomic * folly::Synchronized, mentioned by ot57? https://github.com/facebook/folly/blob/main/folly/docs/Synch... * Boost synchronized data structures, -mentioned by mchicken 53?…
  33. …object. It is generally the preferred synchronization utility at Meta and thus it is widely used. https://github.com/facebook/folly/blob/main/folly/docs/Synch...
  34. https://github.com/facebook/folly/blob/main/folly/docs/Synch...
  35. …people use Result in Rust. (And C++ std::optional<T> is somewhat similar to Rust's Option<T> type.) https://github.com/facebook/folly/blob/main/folly/Expected.h...
    comment by loeg · 2023-03-14 · in Switching from C++ to Rust
  36. You have to use something similar to https://github.com/facebook/folly/tree/main/folly/experiment... to solve this problem. It's a nasty bug that everyone encounters when first working with coroutines. (Similarly everyone will encounter…
  37. https://github.com/facebook/folly/blob/main/folly/docs/Packe... is pretty awesome and I’ve personally gotten big wins from it. The parent mentioned Bloom Filters, HyperLogLog-type stuff is on that family tree and also very interesting and…
  38. …for this (see folly::dynamic[1]). We make extensive use of this at my (non-Facebook) job. [1] https://github.com/facebook/folly/blob/master/folly/docs/Dyn...
    comment by ollien · 2022-05-26 · in Parsing JSON faster with Intel AVX-512
  39. https://github.com/facebook/folly/blob/main/folly/docs/Overv... This has library contents: it’s a mix of various utilities - type conversion, data structures, memory management, random numbers, concurrency, etc.
  40. The docs have a bit more detail about what is included: https://github.com/facebook/folly/blob/main/folly/docs/Overv...
  41. ▲ 95
    Folly: An open-source C++ library developed and used at Facebook
    story by u1tron · 2022-01-07 · 83 comments
  42. Ideally they should be turned into open source projects. Google's https://abseil.io and Facebook's https://github.com/facebook/folly come to mind.
  43. …callable and can be moved but not copied). That's often preferable for storing functors. Example: https://github.com/facebook/folly/blob/main/folly/docs/Funct...
  44. …For example, Facebook's Folly has been updated to use coroutines and is being widely adopted at FB: https://github.com/facebook/folly/tree/main/folly/experiment...
    comment by pavlov · 2021-11-01 · in C++ Coroutines Do Not Spark Joy
  45. …an even better performance implementation using sqrt. Might make sense to port that over to Rust. https://github.com/facebook/folly/blob/master/folly/stats/TD...
  46. Edit: Links to repos: https://github.com/pytorch/pytorch https://github.com/tensorflow/tensorflow https://github.com/facebook/folly
  47. For example folly's vector performs this optimization: https://github.com/facebook/folly/blob/master/folly/docs/FBV...
  48. …) good ( https://software.intel.com/content/www/us/en/develop/documen... ) options ( https://github.com/facebook/folly/tree/master/folly/concurre... ) out there." There are plenty of practical solutions to the safe memory reclamation…
  49. …ticks? http://www.cs.columbia.edu/~nahum/w6998/papers/sosp87-timing... Production implementation: https://github.com/facebook/folly/blob/master/folly/io/async...
    comment by EquallyJust · 2021-05-25 · in Need Something Sorted? Sleep on It
  50. folly::Function was added for exactly this reason I think https://github.com/facebook/folly/blob/master/folly/docs/Fun...
    comment by aptxkid · 2021-04-16 · in Why C++ Is Terrifying