Skip to content

Optimize lazy bitmap container unions - #542

Open
perfloop-agent wants to merge 2 commits into
RoaringBitmap:masterfrom
perfloop:perfloop-pr-open-rnjj17ta95
Open

Optimize lazy bitmap container unions#542
perfloop-agent wants to merge 2 commits into
RoaringBitmap:masterfrom
perfloop:perfloop-pr-open-rnjj17ta95

Conversation

@perfloop-agent

Copy link
Copy Markdown
Contributor

Summary

Make bitmap-to-bitmap lazy unions write directly into a newly allocated result instead of cloning and immediately overwriting the receiver. The fixed-size container loops establish slice bounds once and process four words per iteration, removing repeated bounds checks while preserving deferred cardinality repair. This keeps the manual unrolling tied to the existing 1024-word bitmap-container invariant. Add a ParOr benchmark for four dense inputs with aligned bitmap containers and four workers.

Performance

On workload ParOr over four dense bitmaps with 64 aligned bitmap containers and four workers, median metric ns/op changed from 370418 to 302755; paired median delta -56581 (-15.3% of baseline; at least 19/20 confidence interval -93983 to -41428 from 10 pairs).

Testing

Ran the full Go test suite, the appengine build and test path, and 386, arm, and arm64 builds. Also checked simplified Go formatting and unnecessary conversions; the benchmark validates ParOr cardinality against a sequential union.

All 5 declared correctness checks passed.

Full verification record: https://app.perfloop.ai/t/oss/case_gh0svmf28c

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.

1 participant