Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

If whatever you are doing is heavy on hashmap lookups (and you are ok with not rewriting into something more bespoke+complicated) - the faster hash function and the cheaper baseline cost of calling it - the better (i.e. XXH3 can have disadvantages, with its popular impl. for dispatching to the necessary routine).

This looks like an interesting potential alternative to GxHash. GxHash is nice but sadly I found AES intrinsics to have somewhat high latency on AMD's Zen 2/3 cores, making it a loss on short strings (but until I measured it on our server hw, M4 Max sure had me fooled, it has way better latency despite retiring more AES operations!).



Question, what do you do if there is a collision? I saw the github table also mentioned collisions


They're extremely common in hashtables. You follow standard open addressing or separate chaining procedures: https://en.m.wikipedia.org/wiki/Hash_collision



Do people still use mobile devices? I thought that was like original star trek?


I don't know, all I know is that in my experience some HN commenters don't remove the `.m` from their Wikipedia links. Probably because that's inconvenient to do on mobile devices.


Open any data structures textbook and look for "hash map" in the table of contents.


Fall back on secondary hashes or do probing




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

Search: