pure ruby example: stop using Digest::MD5 and friends; stop using bitset gem; add pure Ruby BitSet class#51
Open
rickhull wants to merge 4 commits intoigrigorik:masterfrom
Open
pure ruby example: stop using Digest::MD5 and friends; stop using bitset gem; add pure Ruby BitSet class#51rickhull wants to merge 4 commits intoigrigorik:masterfrom
Digest::MD5 and friends; stop using bitset gem; add pure Ruby BitSet class#51rickhull wants to merge 4 commits intoigrigorik:masterfrom
Conversation
13f4628 to
58d5d03
Compare
- just use CRC32 - it's fast and works very well for purpose
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
Digest::MD5 and friendsDigest::MD5 and friends; stop using bitset gem; add pure Ruby BitSet class
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)
Contributor
Author
|
also, stop using the old set/set?(plural) interface, and start using |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.