4 ms·
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
by neonsunset 1y ago
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!).
- xkcd1963 1y agoQuestion, what do you do if there is a collision? I saw the github table also mentioned collisions
- lights0123 1y agoThey're extremely common in hashtables. You follow standard open addressing or separate chaining procedures: https://en.m.wikipedia.org/wiki/Hash_collision https://en.m.wikipedia.org/wiki/Hash_collision
- LoganDark 1y agoNon-mobile link: https://en.wikipedia.org/wiki/Hash_collision https://en.wikipedia.org/wiki/Hash_collision
- saagarjha 1y agoFall back on secondary hashes or do probing
- meindnoch 1y agoOpen any data structures textbook and look for "hash map" in the table of contents.