seiflotfy / cuckoofilter

Cuckoo Filter: Practically Better Than Bloom
MIT License
1.13k stars 109 forks source link

Improve performance of utility functions #29

Closed shabbyrobe closed 4 years ago

shabbyrobe commented 4 years ago

Precalculating the hashes in getAltIndex and replacing % with masks gets us a pretty handy speedup when inserting:

BenchmarkFilter_Insert-8     17368         12087         -30.41%

I haven't got a 32-bit machine or OS to test this on at the moment though. Is there anything else you'd like me to test as well?

Edit: tests work fine using Debian Buster in a 32-bit VM.