Repository navigation
Speed up try_push and insert for increasing values - #405
Open
harismuzaffer wants to merge 4 commits into
Open
harismuzaffer wants to merge 4 commits into
harismuzaffer wants to merge 4 commits into
Conversation
cover the two cases reported in RoaringBitmap#390
'h' is the upper bound on the last non-zero word, max() scans down from it instead of word 1023
harismuzaffer
force-pushed
the
fix-390-slow-incremental-sorted-insertion
branch
from
November 23, 2026 11:08
1302c61 to
41f7ced
Compare
This branch has not been deployed
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.
Fixes #390
Adds a new field
htoBitmapStore. This is the index of the highest non-zero word. It could be little too high because only insertions raise it, removals don't updateh- this also meanshcan never be too low.This will minimize the scans in max() which currently always starts at 1023 word
New bechmarks are added and here is the summary of the new bechmarks:
cargo bench -p benchmarks -- "try_push|insert ", comparing against--save-baselineonmain.Machine: , Fedora Linux, x86_64.
try_push/dense 0..1Mtry_push/64 stepinsert 64 step(1M values)insert 1insert severalcreate & insert 1create & insert severalinsert 1 and insert several only re-insert existing values, so they never take the fast path and pay just its extra compares