Hacker News
Comprehensive C++ Hashmap Benchmarks (2022)
stephc_int13
|next
[-]
This is not how you should do benchmarks. Don't take the median, you don't even need to do any "warming up".
Simply run it long enough and only take the best result of each. This is more reliable and correct.
spacechild1
|next
|previous
[-]
I wanted to mention this because boost::unordered_flat_map and boost::unordered_flat_set are among the fastest open addressing hash containers in C++ land. Internally, they use lots of cool SIMD tricks. If anyone is interested in the details, here's a nice blog post by the developer: https://bannalia.blogspot.com/2022/11/inside-boostunorderedf...
zX41ZdbW
|next
|previous
[-]
I've covered it in my presentation: https://presentations.clickhouse.com/2017-hash_tables/
jandrewrogers
|next
|previous
[-]
There is still substantial performance to be gained by creating bespoke hashmap designs at every point of use in code. The high dimensionality of the algorithm optimization space makes it improbable that any specific hashmap algorithm implementation will optimally capture the characteristics of a use case or set of use cases. The variance can be relatively high.
It isn't uncommon to find several independent hashmap designs inside performance-engineered code bases. The sensitivity to small details makes it difficult to build excellent hashmap abstractions with broad scope.