Advanced techniques to implement fast hash tables
attractivechaos.wordpress.com
attractivechaos.wordpress.com
I've been learning rust recently. As a learning exercise, I compared the robin-hood hashing of std::collections::HashMap in rust to his klib/khash he mentions in this article , and then tried various hash functions to try and match his performance:
https://github.com/gaberudy/hash_test
No dice, his hash table is smaller and faster.
My next step is to try and implement his data structure and hashing functions directly in rust and see if I can get it to near-C performance...
Damn fast is only relative. It's damn fast compared to the previous implementations. Wikipedia even dares to say that the worst hash tables of all, perl5, is one of the very best. Bias all over.
SIMD optimized hash tables, such as the Swiss tables tricks have the potential to be much faster than khash. And khash is not cache oblivious at all, with its double hashing scheme.
What is the advantage of this?
That may mean wanting something else less.
If that's not acceptable, they didn't want to.
And that's fine.