bloomfilter-rb icon indicating copy to clipboard operation
bloomfilter-rb copied to clipboard

pure ruby example: stop using `Digest::MD5` and friends; stop using bitset gem; add pure Ruby BitSet class

Open rickhull opened this issue 1 year ago • 3 comments

  • just use CRC32
  • it's fast and works very well for purpose

This PR reduces dependencies and complexity while improving performance and silencing some warnings. It also renames "hashes" to "aspects". Consider that a CRC is not a hash. Anyway, if this part is controversial, I can revert / rename.

rickhull avatar Mar 11 '24 22:03 rickhull

Also: I now have a pure Ruby BitSet impl: https://github.com/rickhull/compsci/blob/master/lib/compsci/bitset.rb

We can easily adapt it here and remove the bitset gem dependency, which is a C extension, rather unmaintained. It fails to build on ARM right now.

The pure ruby BitSet is half the performance of the C extension, but that's a win in my book.

rickhull avatar Mar 20 '24 01:03 rickhull

I updated the PR to include the pure ruby BitSet impl and remove the bitset gem

rickhull avatar Mar 22 '24 15:03 rickhull

also, stop using the old set/set?(plural) interface, and start using #add(singular) and #include?(singular)

rickhull avatar Mar 26 '24 22:03 rickhull