Bitset iteration optimization and improve safety#3753
Merged
fjy merged 3 commits intoapache:masterfrom Dec 7, 2016
Merged
Conversation
Member
Author
gianm
requested changes
Dec 7, 2016
Contributor
gianm
left a comment
There was a problem hiding this comment.
👍 on the main code change but please adjust the test code as mentioned.
| new BitSetBitmapFactory(), | ||
| new ConciseBitmapFactory() | ||
| // Exclude Roaring because it fails yet! | ||
| //new RoaringBitmapFactory() |
Contributor
There was a problem hiding this comment.
What exactly fails here? Is it bad that it fails? If it's not bad, why are we testing it?
Please add a comment here answering those questions (and linking anything we're waiting for upstream in Roaring) or else remove the tests if they're not testing something we actually care about.
gianm
approved these changes
Dec 7, 2016
Contributor
|
thanks, LGTM |
Contributor
|
👍 |
dgolitsyn
pushed a commit
to metamx/druid
that referenced
this pull request
Feb 14, 2017
* Deduplicate looking for bitset.nextSetBit() in BitSetIterator.next() and hasNext() * Add BitmapIterationTest * More elaborate comment on why Roaring is not tested in BitmapIterationTest
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.
bitset.nextSetBit()inBitSetIterator.next()andhasNext()Iteratorcontract, should throwNoSuchElementExceptionon callingnext()afterhasNext() = false. Before it was returning -1, that is bug-prone.BitmapIterationTestwhich verifies Bitmap iteration implementations. BTW it fails for Roaring right now, but immediate fix is not possible, because it's a library dependency.It makes iteration over a bitset 20-30% faster (before-after, benchmarks from #3751):
This is a copy of metamx/bytebuffer-collections#37