Hacker News new | past | comments | ask | show | jobs | submit login

How does that compare to the dict implementation of Python 3.6 ? It's supposed to be damned fast but I don't have the skills to make such comparisons.



The split keys and values arrays in Python 3.6 dictionaries make it more compact than dictionaries from earlier versions of Python, which makes it more cache friendly. But Python dictionaries (and sets) use a variant of double hashing for collision resolution, which is less cache friendly than Robin Hood hashing's linear probing. It's certainly possible to combine both techniques to come up with a hybrid dictionary with the best aspects of both split keys and Robin Hood hashing.


Python, ruby, php hash tables are roughly 2x slower. perl5's being the worst maybe 4x slower.

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.


Does it preserves insertion order ?


Of course not. hash table iteration should assume random order, otherwise it's a security risk or performance nightmare.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: