FOLLY: Components

FOLLY: Components



Arena.h is a simple arena for memory allocation.

ThreadCachedArena.h is arena.h with threaded version.

AtomicHashMap.h, AtomicHashArray.h, AtomicLinkedList.h, 

 Many of these are built with very specific tradeoffs and constraints in mind that make them faster than their more general counterparts. Every header contains information about the trade offs.

These are high performance atomic data structure.

Benchmark.hIt is a small framework for benching code.

Bits.h: An implementation of the structure described in A Provably Correct Scalable Concurrent Skip List by Herlihy et al.

Conv.h: A variety of data conversion routines (notably to and from string), optimized for speed and safety.

Demangle.h: Pretty-printing C++ types.


Dynamically-typed object, created with JSON objects in mind. DynamicConverter.h is a utility for efficiently converting from a dynamic to a more concrete structure when the scheme is known (e.g. json -> map<int,int>).

EvictingCacheMap.h: A simple LRU hash map.

FBString.h: A drop-in implementation of std::string with a variety of optimizations.

FBVector.h: A mostly drop-in implementation of std::vector with a variety of optimizations.

File.h: A C++ abstraction around files.

Fingerprint.h: Rabin fingerprinting.

GroupVarint.h: Group Varint encoding for 32-bit values.

IPAddress.h: A collection of utilities to deal with IPAddresses, including ipv4 and ipv6.


Various popular hash function implementations.

Subprocess.h: Subprocess library, modeled after Python's subprocess module.

IntrusiveList.h: Convenience type definitions for using boost::intrusive_list.

Histogram.h: Convenience type definitions for using boost::intrusive_list.

json.h:JSON serializer and deserializer. Uses dynamic.h.

Malloc.h, Memory.h

Memory allocation helpers, particularly when using jemalloc.

Random.h: Defines only one function---randomNumberSeed().

Range.h: Boost-style range facility and the StringPiece specialization.

RWSpinLock.h: Fast and compact reader-writer spin lock.

PackedSyncPtr.h: A highly specialized data structure consisting of a pointer, a 1-bit spin lock, and a 15-bit integral, all inside one 64-bit word.


ProducerConsumerQueue.h: Lock free single-reader, single-writer queue.


sorted_vector_types.h: Collections similar to std::map but implemented as sorted vectors.




ThreadCachedInt.h: High-performance atomic increment using thread caching.

Traits.h: Type traits that complement those defined in the standard C++11 header <traits>.

Unicode.h: Defines the codePointToUtf8 function


Uri.h : Collection of URLs.

ThreadLocal.h:  Improved thread local storage for non-trivial types.

MicroSpinLock.h: A really, really small spinlock for fine-grained locking of lots of teeny-tiny data.

Preprocessor.h: Necessarily evil stuff.