A C++ implementation of a fast hash map and hash set using hopscotch hashing

github.com

88 points by gjvc 10 hours ago


nly - an hour ago

My goto these days (and afaik the state of the art) is boost::unordered_flat_set paired with rapidhash for hashing (since the GNU std::hash functions based on murmurhash are ridiculously slow)

The cacheline performance is pretty hard to beat (SIMD optimised linear scan before hopping), which is where all the wins come in the real world.

But basically any of the faster hash maps from absl, boost or folly are going to wreck the standard library in terms of perf

jll29 - 6 hours ago

google::dense_hash_map is faster than this new implementation according to their benchmark's diagram (google::dense_hash_map has the lowest runtime of all tested methods).

mgaunard - 9 hours ago

How does it compare to boost unordered flat map?

Looks like the benchmarks were last updated in 2019.

teo_zero - 4 hours ago

The concept is very similar to robin hood. In fact most of the performance charts show that the curves of hopscotch and robin hood are very close. I think I'd prefer robin hood as it's well known.