A first iteration of benchmarks of different hash table implementations.

Candidates

Tested implementations

C++11 unordered_map – Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn)

– Apple LLVM version 5.0 (clang-500.2.79) (based on LLVM 3.3svn) C++ Google DenseHash – Google SparseHash v2.0.2

– Google SparseHash v2.0.2 Java native HashMap – Java(TM) SE Runtime Environment (build 1.7.0_51-b13)

– Java(TM) SE Runtime Environment (build 1.7.0_51-b13) C khash – Above clang environment with khash v0.2.8

– Above clang environment with khash v0.2.8 Lua builtin – LuaJIT v2.0.3

Environment

A 2.6 GHz i7 Macbook Pro, 8 GB RAM, running Mac OS X 10.9.1.

Source

https://code.google.com/p/hash-table-benchmarks/

Random integer lookups with a hit probability of 100%

Random integer lookups with a hit probability of 95%

Random integer lookups with a hit probability of 50%

Random integer lookups with a hit probability of 5%

Random integer lookups with a hit probability of 0%