|
|
|
|
|
by mgunlogson
3494 days ago
|
|
The thing with Cuckoo filters is that the item's alternate position is determined solely from it's current position and fingerprint. Mathematically this is done by XOR'ing with a magic mixing constant borrowed from Murmur2 :) (or in my lib from Mumur3). The quality of the randomness of alternate bucket positions is...probably bad, but in practice it seems to work fine. Because of this finding alternate positions doesn't require a rehash per se, just a few CPU instructions. However, there IS a corner case that requires re-hash that comes up more frequently the shorter the fingerprints used. Conceptually a tag/fingerprint of zero means empty bucket, and occasionally the fingerprint hash for an item will end up being zero. In this case I've seen some libraries just add 1, which I didn't really like since it increases hash collisions slightly. Or you can do it like my lib does and just re-hash the item with a salt. |
|