• Nathan Bronson's avatar
    F14 hash table in folly · 93d49bcf
    Nathan Bronson authored
    Summary:
    F14 is a 14-way probing hash table that resolves collisions by double
    hashing.  Up to 14 keys are stored in a chunk at a single hash table
    position.  SSE2 vector instructions are used to filter within a chunk;
    intra-chunk search takes only a handful of instructions.  "F14" refers
    to the fact that the algorithm "F"ilters up to "14" keys at a time.
    This strategy allows the hash table to be operated at a high maximum
    load factor (12/14) while still keeping probe chains very short.
    
    F14 provides compelling replacements for most of the hash tables we use in
    production at Facebook.  Switching to it can improve memory efficiency
    and performance at the same time.  The hash table implementations
    widely deployed in C++ at Facebook exist along a spectrum of space/time
    tradeoffs.  The fastest is the least memory efficient, and the most
    memory efficient is much slower than the rest.  F14 moves the curve,
    simultaneously improving memory efficiency and performance when compared
    to the existing algorithms, especially for complex keys and large maps.
    
    Reviewed By: yfeldblum
    
    Differential Revision: D7154343
    
    fbshipit-source-id: 42ebd11b353285855c0fed5dd4b3af4620d39e98
    93d49bcf
CMakeLists.txt 28 KB