Accelerate bitmap scanning with Neon and SVE on Arm
Introduction
Optimize database bitmap scanning with SVE and Neon
Build and manage a bit vector in C
Implement scalar bitmap scanning in C
Vectorized bitmap scanning with Neon and SVE
Benchmarking bitmap scanning across implementations
Applications and optimization best practices
Next Steps
Accelerate bitmap scanning with Neon and SVE on Arm
Review frequently asked questions
These FAQs were drafted with an approved AI-assisted workflow and reviewed by Arm contributors before publication. Human technical review remains part of the process so the final page reflects engineering rigor, accuracy, and Arm editorial standards.
Use a single source file named
bitvector_scan_benchmark.c. Add the bit vector type, helper functions, scalar scan routines, Neon and SVE implementations, and the benchmarking code into this file as directed.The data structure must include a byte array that holds the bits, the physical size in bytes, and the logical size in bits. The same file must also add helpers to generate and analyze test bitmaps.
Start with the per-bit scalar baseline, then the optimized scalar version, followed by the Neon implementation, and finally SVE. After each addition, run the benchmark to compare against the previous versions.
The framework measures elapsed time for each scan function over a chosen number of iterations and tracks how many set-bit positions were found. Use the same input bitmap and iteration count when comparing implementations.
Use the provided bitmap generation helpers to create datasets with varying densities. Sparse and dense bitmaps highlight different behaviors across the scalar, Neon, and SVE implementations.