[perf] faster sparse bitpacked filter & take - #9723
lwwmanning wants to merge 2 commits into
Conversation
Merging this PR will improve performance by 36.9%
|
| Mode | Benchmark | BASE |
HEAD |
Efficiency | |
|---|---|---|---|---|---|
| ⚡ | WallTime | threshold_neon[8] |
4.6 µs | 1.7 µs | ×2.7 |
| ⚡ | WallTime | threshold_avx2[8] |
3.4 µs | 1.7 µs | +94.7% |
| ⚡ | WallTime | threshold_neon[8] |
3.2 µs | 1.8 µs | +79.55% |
| ⚡ | WallTime | threshold_neon[160] |
8.5 µs | 4.9 µs | +71.94% |
| ⚡ | WallTime | threshold_avx512[8] |
3 µs | 1.8 µs | +70.39% |
| ⚡ | WallTime | threshold_neon[64] |
4.7 µs | 2.9 µs | +63.39% |
| ⚡ | WallTime | threshold_avx2[8] |
2.5 µs | 1.7 µs | +44.48% |
| ⚡ | WallTime | threshold_avx2[160] |
6.3 µs | 4.6 µs | +37.63% |
| ⚡ | WallTime | threshold_avx512[192] |
6.5 µs | 4.7 µs | +36.6% |
| ⚡ | WallTime | threshold_avx512[160] |
5.9 µs | 4.4 µs | +34.06% |
| ⚡ | WallTime | threshold_avx512[8] |
2.3 µs | 1.7 µs | +33.28% |
| ⚡ | WallTime | filter_neon[64] |
3.2 µs | 2.4 µs | +31.21% |
| ⚡ | WallTime | threshold_neon[192] |
9.2 µs | 7.1 µs | +30.43% |
| ⚡ | WallTime | threshold_neon[32] |
2.9 µs | 2.3 µs | +28.18% |
| ⚡ | WallTime | threshold_neon[8] |
2.2 µs | 1.7 µs | +27.7% |
| ⚡ | WallTime | threshold_avx2[192] |
7 µs | 5.5 µs | +27.15% |
| ⚡ | WallTime | filter_neon[160] |
5.7 µs | 4.5 µs | +26.45% |
| ⚡ | WallTime | threshold_neon[80] |
5.1 µs | 4.1 µs | +24.08% |
| ⚡ | WallTime | threshold_avx2[80] |
3.9 µs | 3.1 µs | +23.73% |
| ⚡ | WallTime | threshold_avx512[64] |
3.3 µs | 2.7 µs | +22.82% |
| ... | ... | ... | ... | ... | ... |
ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.
Tip
Curious why performance improved? Comment @codspeedbot explain why performance improved on this PR, or directly use the CodSpeed MCP with your agent.
Comparing wm/fastlanes-sparse-extraction (895c184) with rk/fastlanes-sparse-benchmarks (f17daff)
Footnotes
-
218 benchmarks were skipped, so the baseline results were used instead. If they were deleted from the codebase, click here and archive them to remove them from the performance reports. ↩
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
This PR has been marked as stale because it has been open for 14 days with no activity. Please comment or remove the stale label if you wish to keep it active, otherwise it will be closed in 7 days |
1799391 to
ba3a6e2
Compare
|
I have rebased this and reduced some of the benchmarks. Let's merge benchmarks first and then improvements. Hard to judge impact. FWIW even with #9721 there's still an improvement here but it's smaller |
Signed-off-by: Will Manning <will@willmanning.io> Signed-off-by: "Robert Kruszewski" <github@robertk.io>
Signed-off-by: Will Manning <will@willmanning.io> Signed-off-by: "Robert Kruszewski" <github@robertk.io>
ba3a6e2 to
895c184
Compare
Summary
Why
The old sparse paths called
unpack_singleonce for each selected value. Each call repeated dispatch and setup work.FastLanes 0.7.1 adds
unpack_indices. It extracts an index batch with one dispatch.The local crossover limits are 16, 32, 64, and 160 values for
u8,u16,u32, andu64.These limits match the conservative FastLanes policy. Local Apple M1 tests supported the same limits or larger limits.
Benchmarks
The previously reported measurements used release mode on an Apple M1 and three packed bit widths per type. The retained benchmark matrix in #9900 uses the middle width for each type. The baseline uses the old Vortex code with FastLanes 0.7.1.
Each case selects eight values from each of eight chunks. The array contains 64 chunks, which avoids the outer full-decode policies.
The table shows the median improvement range across three packed bit widths.
u8u16u32u64The benchmarks also cover each crossover limit and values above each limit.
Verification
The following checks were reported before this PR was split. Tests and benchmarks were not rerun for the split; the combined stack preserves the original tree exactly.
cargo test -p vortex-fastlanescargo clippy -p vortex-fastlanes --all-targets --all-features -- -D warningscargo clippy --all-targets --all-features -- -D warningscargo bench -p vortex-fastlanes --bench bitpacking_filter -- thresholdcargo bench -p vortex-fastlanes --bench bitpacking_take -- threshold