Skip to content

In place XOR#509

Merged
lemire merged 2 commits intoRoaringBitmap:masterfrom
DhruvilK7:master
Feb 9, 2026
Merged

In place XOR#509
lemire merged 2 commits intoRoaringBitmap:masterfrom
DhruvilK7:master

Conversation

@DhruvilK7
Copy link
Contributor

@DhruvilK7 DhruvilK7 commented Feb 8, 2026

It is almost at same performance if the second bitmap is much sparser than the first or two random bitmaps with the same cardinality and range. However it is much faster for two dense bitmaps.

Fulfills part of #27.

Benchmark:

benchmark                           old ns/op     new ns/op     delta
BenchmarkXor-11                     785310        775829        -1.21%
BenchmarkXorLopsided-11             89268         89067         -0.23%
BenchmarkXorDense-11                116055        64905         -44.07%

benchmark                           old allocs    new allocs    delta
BenchmarkXor-11                     6108          6108          +0.00%
BenchmarkXorLopsided-11             3120          3120          +0.00%
BenchmarkXorDense-11                100           0             -100.00%

benchmark                           old bytes     new bytes     delta
BenchmarkXor-11                     513732        513733        +0.00%
BenchmarkXorLopsided-11             210225        210225        +0.00%
BenchmarkXorDense-11                411204        0             -100.00%

@lemire
Copy link
Member

lemire commented Feb 9, 2026

Please run go fmt if you can.

@DhruvilK7
Copy link
Contributor Author

done

@lemire lemire merged commit 3fe77fa into RoaringBitmap:master Feb 9, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants