Skip to content

A comparison of the performance of different hash functions for Cuckoo Hashing

License

Notifications You must be signed in to change notification settings

maumueller/HashingExperiments

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Performance of different hash functions in Cuckoo Hashing

Source code used in the hashing experiments of the thesis On the Analysis of Two Randomized Algorithms: Multi-Pivot Quicksort and Efficient Hash Functions. The code measures running time and cache behavior of the constructions, more cpu measures can be easily added.

Hashing Functions

The following hash functions are compared:

  • Polynomial hashing (using the Carter-Wegman-Trick)
  • Multiply-Shift
  • Tabulation-Hashing
  • Tabulation + Universal hashing (ADW)
  • Murmur3

Results

Number of keys inserted Tabulation (1 Byte Characters) Tabulation (2 Bytes Characters) Murmur3 3-independent Hashing Tabulation + Universal
4194304 286.32 ms 293.20 ms 312.13 ms 375.00 ms 510.35 ms

The numbers show the average time it took to insert around 4 million keys into the cuckoo hash table using the specific hashing scheme see. (Threshold set very close to the theoretical limit at 49.995% load.) See the thesis for more results and details.

Dependencies

Needs g++, cmake in version >= 2.8, libboost-random and libpapi for performance measurements. (Enabled by default, can be changed in CMakeLists.txt.)

How to build

Use the following commands on the top-level directory of the project.

mkdir build; cd build cmake .. make

For a release build with optimization flags, use

cmake -DCMAKE_BUILD_TYPE=Release

After successful compilation, the executable is located at build/src/hashingtest.

Examples

Example calls can be found in the directory examples.

Evaluation

The output generated by the program can be directly read and processed using the beautiful SqlPlotTools.

About

A comparison of the performance of different hash functions for Cuckoo Hashing

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published