Skip to content
/ HAMT Public
forked from chaelim/HAMT

Hash Array Mapped Trie (C++ Templates)

License

Notifications You must be signed in to change notification settings

andyPark/HAMT

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

C++ Template class implementation of Hash Array Mapped Trie

Do you want space-efficient and fast hash table? HAMT is just here for you. Based on the paper Ideal Hash Trees by Phil Bagwell, and as the title stated, it has really ideal features as a hash table as below.

Features

  • No initial root hash table required. (Empty hash table just takes 8 bytes in 32 bit build or 12 bytes in 64 bit build.)
  • No stop the world rehashing.
  • Faster and smaller.
  • Constant add/delete O(1) operations
  • C++ Template implementation can be easily used to any data type.
  • 32 bit hash key and 32 bit bitmap to index subhash array.
  • 32 bit integer and string (ANSI and Unicode) hash key templates are included.
  • Expected tree depth: equation.
    w = 5
    n : number of elements stored in the trie
  • Hamming weight of bitmap can be caculated using POPCNT(Population count) CPU intruction (introduced in Nehalem-base and Barcelona microarchitecture CPU). POPCNT can speed up overall performance about 10%.

Test program build notes

More information

About

Hash Array Mapped Trie (C++ Templates)

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 100.0%