Table of Contents
- Overview
- Construction Benchmarks
- Modifying Benchmarks
- Accessing
- Conclusion
This benchmark is the same as previous, but with 4000 lookups for every 4 inserts until the map contains 500k elements.
Results
Hashes
Same behavior as for the other benchmarks: robin_hood::hash
is fastest, absl::Hash
second, and libstdc++-v3
problematic.
Hashmaps
This time emilib::HashMap
is not the winner any more. It seems to be well tuned for smaller maps, but the fastest maps for larger data are phmap::flat_hash_map
and absl::flat_hash_map
. I find it interesting that the node maps are performing so well even though they add a layer of indirection. robin_hood::unordered_node_map
even performs a bit better than robin_hood::unordered_flat_map
. robin_hood::unordered_flat_map
’s peak memory is very small, only tsl::sparse_map
uses less RAM - unfortunately below the measurement barrier, so I only have 0 as a number.
Chart
Each entry shows average time for a single find
and access operation (if found). The final number is average over all entries.
- blue: 0% find success, bitmask
0x00000000FFFFFFFF
(only lower bits) - orange: 0% find success, bitmask
0xFFFFFFFF00000000
(only upper bits) - green: 25% find success, bitmask
0x00000000FFFFFFFF
(only lower bits) - red: 25% find success, bitmask
0xFFFFFFFF00000000
(only upper bits) - magenta: 50% find success, bitmask
0x00000000FFFFFFFF
(only lower bits) - brown: 50% find success, bitmask
0xFFFFFFFF00000000
(only upper bits) - pink: 75% find success, bitmask
0x00000000FFFFFFFF
(only lower bits) - gray: 75% find success, bitmask
0xFFFFFFFF00000000
(only upper bits) - lime: 100% find success, bitmask
0x00000000FFFFFFFF
(only lower bits) - cyan: 100% find success, bitmask
0xFFFFFFFF00000000
(only upper bits)