explaingit

facebook/folly

📈 Trending30,384C++Audience · developerComplexity · 3/5ActiveLicenseSetup · moderate

TLDR

A collection of high-performance C++ components and data structures used at Meta, filling gaps in the standard library with designs optimized for large-scale production systems.

Mindmap

mindmap
  root((Folly))
    What it does
      Data structures
      Algorithms
      Utilities
      Performance optimized
    Tech stack
      C++20
      Static library
      Cross-platform
    Use cases
      High-load systems
      Meta projects
      Performance critical
    Audience
      C++ developers
      Systems engineers
      Infrastructure teams

Things people build with this

USE CASE 1

Build high-performance server applications that handle heavy traffic without standard library bottlenecks.

USE CASE 2

Use as a dependency for other Meta open-source C++ projects that already require Folly components.

USE CASE 3

Optimize data structure performance in latency-sensitive systems by swapping standard library alternatives with Folly equivalents.

USE CASE 4

Access production-tested utilities and abstractions that Facebook engineers rely on at scale.

Tech stack

C++20LinuxmacOSiOSWindows

Getting it running

Difficulty · moderate Time to first run · 30min

Requires C++20 compiler and build system setup (CMake or similar); no external dependencies but compilation time varies by platform.

Use freely for any purpose, including commercial use, as long as you keep the copyright notice and license text.

In plain English

Folly is an open-source C++ library developed and used internally at Facebook (now Meta). It is not a single unified toolkit but rather a collection of independent, reusable C++ components, data structures, algorithms, utilities, and abstractions, that Facebook engineers found useful enough to share publicly. The name is loosely an acronym for "Facebook Open-source Library." The library fills gaps that the C++ standard library and other common libraries like Boost do not cover, or covers them with better performance characteristics suited to operating at large scale. Performance is a central theme throughout: the README notes that some designs are more unconventional than they would be otherwise precisely because they optimize for speed in high-traffic production systems. Folly is written using C++20 features, the current modern version of the C++ language standard. In practice, Folly often appears as a dependency of other Facebook open-source projects that are themselves written in C++, serving as a shared foundation. Individual components in Folly are relatively self-contained, so a project might depend on only a few of them rather than the entire library. A C++ developer would use Folly when they need a data structure or utility that performs better than the standard library alternative under heavy load, or when building software that depends on other Meta open-source projects that already require it. It is built as a static library and supports Linux, macOS, iOS, and Windows.

Copy-paste prompts

Prompt 1
Show me how to use Folly's concurrent data structures instead of std::vector for a multi-threaded producer-consumer system.
Prompt 2
What Folly components should I include in my C++ project if I only need fast string handling and memory pooling?
Prompt 3
Help me integrate Folly as a dependency in my CMake build and use its high-performance hash map.
Prompt 4
Explain which Folly utilities would improve performance in a real-time event processing pipeline compared to standard C++ libraries.
Prompt 5
How do I build Folly from source on macOS and link it to my existing C++20 project?
Open on GitHub → Explain another repo

Generated 2026-05-18 · Model: sonnet-4-6 · Verify against the repo before relying on details.