Experiences with Facebook's C++ library
summary
Facebook's open source C++ library folly focuses on practical fixes: a new conversion utility borrows fast float code from V8; dynamic handles JSON parsing/serialization; throw/catch costs measure ~53× slower than return values so exception_wrapper and an exception tracer are used instead. Thread-local tools include a thread-local access-all-threads API for aggregating per-thread counters. Read-mostly shared pointers shard refcounts to avoid contention for single-line refcounts, singletons can be quiesced before fork, LIFO condition wakes cut latency ~1%, and an indexed mempool avoids reclamation but shows 16-bit ABA tagging crashed roughly every six hours.
AI-written summary · about
chapters (16)
- 0:00Introduction to Folly
- 1:03Purpose and history of Folly
- 2:29Transition to modern C++ standards
- 3:09Optimized containers in Folly
- 4:57Synchronization tools
- 7:42String optimizations
- 9:04Exception handling strategies
- 13:21Bit manipulation utilities
- 16:09Dynamic typing with Dynamic
- 18:34Thread-local storage techniques
- 26:58Singleton patterns
- 33:18Synchronization primitives
- 39:24Condition variable optimizations
- 41:51Futures and executors
- 44:18Indexed memory pool
- 47:07Conclusion and resources
related talks
59mMaking Testing C++ Binaries Practical @ Facebook Scale: A CI Story
01h 02mFunctional C++
59mSoftware Engineering Is About Tradeoffs
01h 03mFunctional C++ for Fun & Profit
01h 01mGeneric Locking in C++
01h 08mBetter Code: Concurrency
58mFrom Functional to Parallel: Stochastic Modeling in C++
01h 21mImproving Performance and Maintainability in Modern C++
