Repository navigation
Use AVX2 for dense in-place XOR - #550
Closed
perfloop-agent wants to merge 1 commit into
Closed
perfloop-agent wants to merge 1 commit into
perfloop-agent wants to merge 1 commit into
Conversation
Signed-off-by: Tomás Senart <ts@perfloop.ai>
perfloop
Bot
force-pushed
the
perfloop-pr-open-je71hpbx27
branch
from
November 8, 2026 01:24
25b8646 to
ed00e0a
Compare
Contributor
Author
|
Closing this pull request. On the repository's real datasets the dense XOR path is reached, but the most this change could save is about 3% of the operation, which is inside the run-to-run noise we measured (about ±12%). That does not justify the extra code. Thank you for your time. |
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
This adds an AVX2 fallback for dense bitmap XOR stores on amd64. The existing AVX-512 path remains first, and portable builds keep their scalar implementation.
Type of Change
Changes Made
What was changed?
Why was it changed?
How was it changed?
xorSliceselects AVX-512, then AVX2, then the existing portable loop.Testing
go test ./...go test -tags=appengineGOARCH=arm64 go build .GOARCH=386 go build .go tool unconvert ./...Checks: 5 passed.
Formatting
The changed Go files are gofmt-formatted.
Fuzzing
Not run. This change does not touch serialization or fuzzing code.
Performance Impact
On amd64 CPUs without the AVX-512 bitmap-operations path, dense XOR uses AVX2 vector stores instead of the portable word loop. AVX-512, non-amd64, appengine, and non-AVX2 paths are unchanged, with no new allocation or public API.
Workload:
Bitmap.Xor on 50 dense matching containers with AVX-512 disabledns/opRunning Benchmarks
BenchmarkXorDensecovers the in-place dense path, andBenchmarkDenseBitmapOps/Xorcovers the shared out-of-place path. Both fallback measurements disable AVX-512 so the AVX2 selection is exercised.Performance Analysis
The implementation is limited to the existing plain XOR backend. It preserves the low-cardinality array conversion and the existing architecture fallbacks.
Breaking Changes
None.
Related Issues
N/A
Additional Notes
None.
Generated by Perfloop. Human sponsor: Tomás Senart. Measurements and checks.