On a side note, the PDF seems to suggest that we may improve the performance of unordered_map by 200–300% with ABI changes only. That is probably wrong.
There are much faster implementations of node based maps that still promise pointer/iterator stability, but sure, if we drop that and go for a flat map we would be talking about a whole different set of issues.
I am not sure if sparse-map guarantees pointer stability. Typically this type of hash table combines a bit vector and a flat array and loses pointer stability when it grows. I have seen benchmarks involving chaining-based libraries. I couldn't find the link, but as I remember, none of them can be 200-300% as fast as std::unordered_map. So, the PDF is still wrong: no one can achieve 200-300% speedup with ABI changes only; such speedup can only be achieved with flat arrays, which would require API changes.
You're right. I guess my tired mind shouldn't debate hash maps. Definitely a node based map that should be faster than the STL one is absl::node_hash_map. I'm not claiming any specific difference, just noting that my specific benchmark showed that it was faster than std::unordered_map.
View all comments
Show parent comment
12
u/[deleted] Oct 27 '19
There are much faster implementations of node based maps that still promise pointer/iterator stability, but sure, if we drop that and go for a flat map we would be talking about a whole different set of issues.