March 30, 2026

Hashmaps, hot takes, and hurt feelings

Comprehensive C++ Hashmap Benchmarks (2022)

3 years, 29 maps, 1,914 races — and everyone’s mad their fave wasn’t invited

TLDR: A massive C++ hashmap showdown tested 29 maps across 1,914 runs to see which structures are fastest. The comments blew up over missing favorites (Qt QHash, parallel-hashmap, Boost’s flat map) and whether benchmarks even predict real-world speed, splitting fans between leaderboard lovers and “it depends” pragmatists.

After three years, the “which C++ hashmap is actually fast?” saga returns with 29 contenders, 6 hashes, and a mind-blowing 1,914 tests. The author locked the CPU like a race steward, ran everything the same way, and dropped a giant scoreboard. But the real fireworks? The comments. First wave: the “Where’s my map?” crowd. One person asked for Qt’s QHash. Another demanded the parallel-hashmap because “thread-safety plus speed.” Then came the hype train for Boost’s late-2022 newcomer, unordered_flat_map, praised for “SIMD tricks” (computer-speak for doing many tiny tasks at once) and rumored to be blazing fast.

Next wave: the philosophers. “Benchmarks are fine, but your mileage will vary,” they said, arguing that real apps need custom-built maps tuned for their exact data. Translation: pretty charts are fun, but your code is a different planet. Cue the meme war: speed-chart stans vs “it depends” realists. There were jokes about “Hashmap Hunger Games,” calls for a re-run with post-2022 contenders, and friendly nitpicks about compile flags like they’re F1 pit strategies.

Bottom line: epic effort, spicy debate, and a classic internet plot twist — no matter how big the benchmark, someone’s favorite didn’t make the cut.

Key Points

  • 29 hashmaps were benchmarked, combined with 6 hash functions, yielding 174 configurations.
  • Each configuration was tested across 11 benchmarks for a total of 1,914 evaluations.
  • Tests ran on an Intel Core i7-8700 at 3.2 GHz with turbo and frequency scaling disabled, on Manjaro Linux using clang++ 13 and -O3 -march=native.
  • Hashmaps are categorized by reference stability; open addressing variants often trade reference stability for speed via better cache locality and fewer indirections.
  • Benchmarks included a large copy test, a 100M insert/clear/reinsert/erase sequence, and a 50M random insert/access test with varying distinctness levels.

Hottest takes

"Would be interested to hear how the Qt QHash compares" — hermitcrab
"Not really comprehesive" — rurban
"use lots of cool SIMD tricks" — spacechild1
Made with <3 by @siedrix and @shesho from CDMX. Powered by Forge&Hive.