dpbriggs / growable-bloom-filters

Safe, Growable Bloom Filters in Rust (with serde)
MIT License
22 stars 6 forks source link

Tunable growth factor and tightening ratio #7

Closed whitfin closed 6 months ago

whitfin commented 6 months ago

The comments above the code here seem to imply they were meant as defaults, but there's no way to provide them for custom values. Was this just something that fell behind, or was it intentionally left out? If the latter, would a contribution be accepted?

I'm trying to migrate to this library, but the library I'm using had hardcoded values of 2 and 0.5, whereas this library is hardcoded to 2 and 0.85. I'd like to move over as this implementation is faster, but not being able to tune the values to match means I have to bump major (as the results are obviously changing).

dpbriggs commented 6 months ago

Interesting - I suppose we could just allow users to specify those values. I wonder if a builder API is overkill? I'll try that out and see how it feels.

dpbriggs commented 6 months ago

Alrighty, 2.1.0 is published! It offers a builder that allows you to specify those values. Let me know if that works for you :^)

whitfin commented 6 months ago

@dpbriggs awesome, this works exactly as I hoped :) thank you for getting to it so quickly!

Edit: just wanted to follow up and thank you again! I embedded this into my project and the results are exactly the same, but the code that uses bloom filters is approximately 3x faster than previously. So thank you for all of your work on this library :)