vitus 2 days ago

The reddit thread mentions that the author was probably going to write a blog post about it at some point; I went and found it so you don't have to.

I was curious what exactly differentiates boost::unordered_flat_map from absl::flat_hash_map, and was not disappointed. It seems that the lion's share of the performance improvement comes from using more of the metadata for the reduced hash value, although there are a few other contributing factors.

The blog post further describes where absl::flat_hash_map performs better: iteration (and consequently erasure), which is ironic given those are a couple of areas where I always felt that absl::flat_hash_map was especially weak. But, it makes sense to double down on Abseil's strengths as well as its shortcomings.

https://bannalia.blogspot.com/2022/11/inside-boostunorderedf...

1
joaquintides 1 day ago

Iteration has been improved since, and now we’re beating Abseil on iteration plus erasure:

https://github.com/boostorg/boost_unordered_benchmarks/tree/...

vitus 1 day ago

Very cool!

I especially like how you can see the load factor across the graphs, where there are sharp downward spikes each time the map resizes, and how they vary as you move through the memory hierarchy.

I am curious what Abseil could learn from other modern hash map implementations, since my understanding is that the fundamental structure of its swisstables implementation hasn't changed meaningfully since 2017.