Robin Hood Hashing 源码分析 | SF-Zhou's Blog #157
Replies: 15 comments 64 replies
-
|
似乎absl也提供了开放寻址的hashmap,上次测试的时候发现性能连std::unordered_map都比不过,有点奇怪。不知道您又没有比较过两者。 |
Beta Was this translation helpful? Give feedback.
-
我自己没有测过,网上可以找到一些 benchmark 数据,比如 Hashmaps Benchmarks,不同测试场景下的性能差别可能很大。 |
Beta Was this translation helpful? Give feedback.
-
|
rehash是硬伤。 |
Beta Was this translation helpful? Give feedback.
-
|
欢迎使用我的hashmap https://github.com/ktprime/emhash/blob/master/hash_table7.hpp |
Beta Was this translation helpful? Give feedback.
-
|
|
Beta Was this translation helpful? Give feedback.
-
|
目前性能实现更好的flat hash map 来自boost,从测试看已经超越前辈swiss table(优化版本). 有兴趣可以跑一跑我的hash map benchmark (持续优化3年,10+个主流flat hash map 最新源码). |
Beta Was this translation helpful? Give feedback.
-
|
上面两个测试过于简单,不同平台测试差异非常大,难以断定那个hashmap更快, 下面这个我也经常跑的测试,第三方代码都统一调整相同的 max_load_factor(不少写死0.5,0.8)
|
Beta Was this translation helpful? Give feedback.
-
|
emhash8 只针对复杂key/value 查询方面比较快 插入性能不怎样,迭代和数组一样快 |
Beta Was this translation helpful? Give feedback.
-
|
老旧的服务器cpu
|
Beta Was this translation helpful? Give feedback.
-
|
下面mbench 中插入 ck 优势非常明显 bench_insert: |
Beta Was this translation helpful? Give feedback.
-
|
intel 9700 统一负载因子 |
Beta Was this translation helpful? Give feedback.
-
|
我在不同机器测试,有时候rigtorp 插入快一点,ck在qbench find miss 比较差,但mbench 测试查询性能还行, |
Beta Was this translation helpful? Give feedback.
-
|
find命中分别从0 25% 50% 75% 100% 累计耗时 |
Beta Was this translation helpful? Give feedback.
-
|
Model name: Intel(R) Xeon(R) Silver 4210 CPU @ 2.20GHz |
Beta Was this translation helpful? Give feedback.
-
|
低负载因子下使用最简单冲突处理,更少的内存消耗意味着插入更快。同时也意味着需要更多内存,查询性能要下降的 |
Beta Was this translation helpful? Give feedback.


Uh oh!
There was an error while loading. Please reload this page.
-
https://sf-zhou.github.io/programming/robin_hood_hashing.html
Beta Was this translation helpful? Give feedback.
All reactions