Skip to content

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

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

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

rickhull
Copy link
Contributor

@rickhull rickhull commented Mar 11, 2024

  • 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 rickhull force-pushed the master branch 2 times, most recently from 13f4628 to 58d5d03 Compare March 11, 2024 22:40
- just use CRC32
- it's fast and works very well for purpose
@rickhull
Copy link
Contributor Author

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.

- remove bitset gem, which is a C extension
- bitset gem does not currently build on ARM
- add pure ruby BitSet implementation
- roughly half the performance of the bitset gem in extensive testing
- plenty fast for practical use
- brought both BitSet and BloomFilter classes up to date with compsci gem
- renamed some ivars and methods
@rickhull rickhull changed the title pure ruby example: stop using Digest::MD5 and friends pure ruby example: stop using Digest::MD5 and friends; stop using bitset gem; add pure Ruby BitSet class Mar 22, 2024
@rickhull
Copy link
Contributor Author

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

- use #add(singular) and #include?(singluar)
- remove #set(plural) and #set?(plural)
@rickhull
Copy link
Contributor Author

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

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