Optimize roaring64 BSI BatchEqual and int64 comparisons#536
Open
guymolinari wants to merge 7 commits into
Open
Optimize roaring64 BSI BatchEqual and int64 comparisons#536guymolinari wants to merge 7 commits into
guymolinari wants to merge 7 commits into
Conversation
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.
Description
Optimizes
roaring64.BSIequality, batch equality, and int64-width comparison paths while preserving the existing public API. The BigValue APIs now internally use the optimized int64 paths when safe, while true wider-than-64-bit values continue to use the existing generic behavior.Type of Change
Changes Made
What was changed?
BatchEqualexecution for int64-widthroaring64.BSIvalues.CompareValuethrough bitmap-native signed int64 comparison logic forLT,LE,EQ,GE,GT, andRANGE.CompareBigValueandBatchEqualBigto delegate to optimized int64 paths when the BSI and query values fit in signed 64-bit space.BatchEqualBigvalue matching so positive and negative values with the same magnitude, such as5and-5, do not collide.roaring64golint comments for touched package readiness.Why was this changed?
The existing BSI64 equality and comparison paths materialized or inspected values row-by-row, which was very expensive for common analytical query shapes. These changes keep the public API stable while allowing int64-width operations to use bitmap algebra directly.
Compatibility
CompareValue,CompareBigValue,BatchEqual, andBatchEqualBigcallers continue to work.CompareBigValueandBatchEqualBigonly delegate to optimized int64 logic when safe.Verification
Run:
Benchmark details are documented in
roaring64/BSI_BENCHMARKS.md.Why was it changed?
How was it changed?
Testing
Please add a unit test if you are fixing a bug.
You must run
Formatting
Please run
Fuzzing
Please run our fuzzer on your changes.
You should see a directory
workdircreated with initial corpus files.Adjust
-fuzztimeas needed for longer or shorter runs. If crashes are found,check the test output and the reproducer files in the
workdirdirectory.You may copy the reproducers to roaring_tests.go
Performance Impact
If applicable, describe any performance implications of these changes and include benchmark results.
Running Benchmarks
This project includes comprehensive benchmarks. Please run relevant benchmarks before and after your changes:
Basic Benchmarks
Parallel Benchmarks
Real Data Benchmarks
Benchmark Results Format
Please include before/after results in the following format:
Performance Analysis
Breaking Changes
If this PR introduces breaking changes, please describe them and the migration path:
Related Issues
Fixes # (issue number)
Related to # (issue number)
Additional Notes
Any additional information or context about this pull request.