|
|
|
|
|
by lower
2645 days ago
|
|
When comparing a Rust rewrite of a C++ codebase, I noticed that Rust's default HashMap and HashSet were noticably slower than unordered_map and unordered_set. The reason is that Rust uses a hash function that has better properties, but that is a bit slower. If the performance of a HashMap is a bottleneck, one can use a simpler hash function to get the same performance as in C++. With FnvHashMap, the performance was the same as unordered_map. |
|
https://github.com/Amanieu/hashbrown
https://blog.waffles.space/2018/12/07/deep-dive-into-hashbro...
https://gankro.github.io/blah/hashbrown-insert/