-
Notifications
You must be signed in to change notification settings - Fork 103
feat/perf: optimize AddRange in RoaringPositionBitmap #608
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
Merged
wgtmac
merged 13 commits into
apache:main
from
Baunsgaard:optimize-addrange-roaring-bitmap
Apr 4, 2026
Merged
Changes from 11 commits
Commits
Show all changes
13 commits
Select commit
Hold shift + click to select a range
acc264b
perf: optimize AddRange in RoaringPositionBitmap
Baunsgaard 520a868
Fix TestOptimize to use Add() instead of AddRange()
Baunsgaard 1f70485
Merge AddRange guard clauses into a single if block
Baunsgaard 3c4ce82
Clamp AddRange to valid positions instead of rejecting entirely
Baunsgaard 45ee748
Simplify AddRange to use a single loop over keys
Baunsgaard 571c076
Fix AddRange doc to accurately describe clamping behavior
Baunsgaard ab7e189
Parameterize AddRange no-op tests
Baunsgaard 7214fa1
Throw on reversed range in AddRange for consistency
Baunsgaard 3c55027
Fix clang-format violations
Baunsgaard 6f7a1db
Fix util_test timeout caused by TestAddRangeClampBeyondMaxPosition
Baunsgaard 9c06f42
Simplify AddRange by removing redundant equality check
Baunsgaard 44df040
Silently ignore reversed ranges in AddRange for consistency
Baunsgaard 4421d7d
Extract pos_last variable to avoid repeated pos_end - 1
Baunsgaard File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
Oops, something went wrong.
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.
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.
Let's return
Statusinstead of throwing exception if you really think this is an invalid case. IMHO, we need to be consistent with line 123 and line 140 to return on invalid inputs.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.
Well, it is an invalid input, however for consistency with other methods in the c++ implementation, then both versions are valid.
Before my changes in the PR to the Java base, it also would not throw any exceptions. since it used the same for loop definition. To keep the existing behaviour, I have removed the exception throwing.