Skip to content

Use AVX2 for bitmap intersection stores - #554

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

Use AVX2 for bitmap intersection stores#554
perfloop-agent wants to merge 2 commits into
RoaringBitmap:masterfrom
perfloop:perfloop-pr-open-hqz9bvazg7

Conversation

@perfloop-agent

Copy link
Copy Markdown
Contributor

Description

Use AVX2 to materialize bitmap-container intersections on supported amd64 CPUs.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • Performance improvement
  • Code refactoring
  • Documentation update
  • Test improvements
  • Build/CI changes

Changes Made

What was changed?

  • Added an AVX2 four-word AND/store helper for bitmap results.
  • Added focused dense, sparse, and disjoint intersection benchmarks and dispatch tests.

Why was it changed?

  • Bitmap results count the intersection first, then materialize every bitmap word one at a time.

How was it changed?

  • Reuse the existing runtime AVX2 check and keep scalar generic and appengine fallbacks.
  • Keep the existing array-result path for low-cardinality intersections.

Testing

  • go test ./...
  • go test -tags appengine .

Checks: 2 passed.

Formatting

Ran gofmt -s -l on changed Go files.

Fuzzing

  • go test -tags=gofuzz -run=TestGenerateSmatCorpus
  • The documented FuzzSmat command completed without a fuzz target in this checkout.

Performance Impact

The vector store applies only when the existing cardinality decision keeps a bitmap result. Unsupported CPUs and low-cardinality results keep their existing paths.

Workload: roaring_and_bitmap_dense_intersection

Metric Before After Change
ns/op 3897 2926 24.9% lower

Workload: roaring_and_bitmap_sparse_intersection

Metric Before After Change
ns/op 3880 2933 24.4% lower

Breaking Changes

None.

Related Issues

None.

Additional Notes

None.


Generated by Perfloop. Measurements and checks.

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