Optimize lazy bitmap container unions - #542
Open
perfloop-agent wants to merge 2 commits into
Open
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.
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 metricns/opchanged 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