Skip to content

Conversation

@panmari
Copy link
Owner

@panmari panmari commented Aug 4, 2022

Implemented by using different types for fingerprints via generics.

Using generics, allowing to switch transparently between uint8 and
uint16 for the fingerprint size.

Performance neutral according to benchmarks

~/goworkspace/bin/benchstat ~/master.benchstats ~/generics.benchstats
name             old time/op  new time/op  delta
Filter_Reset-4   10.0µs ± 0%   9.9µs ± 0%   ~     (p=1.000 n=1+1)
Filter_Insert-4  18.2µs ± 0%  18.0µs ± 0%   ~     (p=1.000 n=1+1)
Filter_Lookup-4  1.52µs ± 0%  1.51µs ± 0%   ~     (p=1.000 n=1+1)
Instead of using multiple methods for instantiating a filter for a
chosen precision.
There is no asymptotic advantage to try both idx & alt idx for an item
to insert. Rather just let cuckoo kickout do it's thing.
Avoids some unnecessary ifs in the implementation.
Previously, items only moved to the alternative index on cuckoo inserts.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants