-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Bitset iteration optimization and improve safety #3753
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
Conversation
gianm
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@gianm done
|
thanks, LGTM |
|
👍 |
* Deduplicate looking for bitset.nextSetBit() in BitSetIterator.next() and hasNext() * Add BitmapIterationTest * More elaborate comment on why Roaring is not tested in BitmapIterationTest
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