4 ms·
We will fix that in the near future. Known problem with our design choice. Wanted to ensure we put it out there first, before solving it. FWIW, note that the pr
by mrjn 7y ago
We will fix that in the near future. Known problem with our design choice. Wanted to ensure we put it out there first, before solving it. FWIW, note that the probability of a collision with 64 bit hash is pretty low. Still, needs to be solved.
- grumpydba 7y agoCould this be solved by some sort of cuckoo hashing?
- mrjn 7y agoThe benefit of current hashing algorithm is that Go team is maintaining it ;-). Its written in assembly and runs in single digit nanoseconds. One way to check for collision would be to either store the key as well or use another hashing algorithm (which would further decrease the probability of collision, but not eliminate it). Either would introduce some slowness, because every Get would need to be checked.
- sethammons 7y agoStoring the key with the value is a solid workaround.
- deleted 7y ago[deleted]
- qes 7y agoI use 128 bit spooky hash for keys in a system with ~1M keys in cache at any given time, give or take. Rough numbers but maybe 75% of those keys existed last month and will still exist next month and probably next year, too, and 25% will exist for minutes to hours and likely never be seen again. Collisions are uncommon, but a regular enough occurrence (dozen or two a year).