Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow multiple precision modes #6

Draft
wants to merge 20 commits into
base: master
Choose a base branch
from
Draft

Allow multiple precision modes #6

wants to merge 20 commits into from

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.

1 participant