Skip to content

[perf] faster sparse bitpacked filter & take - #9723

Open
lwwmanning wants to merge 2 commits into
developfrom
wm/fastlanes-sparse-extraction
Open

[perf] faster sparse bitpacked filter & take#9723
lwwmanning wants to merge 2 commits into
developfrom
wm/fastlanes-sparse-extraction

Conversation

@lwwmanning

Copy link
Copy Markdown
Contributor

Summary

  • This PR updates FastLanes from 0.7.0 to 0.7.1.
  • Sparse filter and take paths now extract each index batch with one FastLanes call.
  • Larger requests still decode a complete 1,024-value block.
  • Existing whole-array decode policies remain unchanged.
  • New benchmarks cover low, middle, and high bit widths for each integer type.

Why

The old sparse paths called unpack_single once 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, and u64.

These limits match the conservative FastLanes policy. Local Apple M1 tests supported the same limits or larger limits.

Benchmarks

I ran the benchmarks in release mode on an Apple M1. 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.

Type Filter Take
u8 17-23% 15-19%
u16 17% 27-34%
u32 15-18% 46-50%
u64 13-18% 65-67%

The benchmarks also cover each crossover limit and values above each limit.

Verification

  • cargo test -p vortex-fastlanes
  • cargo clippy -p vortex-fastlanes --all-targets --all-features -- -D warnings
  • cargo clippy --all-targets --all-features -- -D warnings
  • cargo bench -p vortex-fastlanes --bench bitpacking_filter -- threshold
  • cargo bench -p vortex-fastlanes --bench bitpacking_take -- threshold

Signed-off-by: Will Manning <will@willmanning.io>
Signed-off-by: Will Manning <will@willmanning.io>
@lwwmanning lwwmanning changed the title perf(fastlanes): Batch sparse bit-packed extraction [perf] faster sparse bitpacked filter & take Sep 1, 2026
@codspeed-hq

codspeed-hq Bot commented Sep 1, 2026

Copy link
Copy Markdown

Merging this PR will regress 1 benchmark

⚠️ Unknown Walltime execution environment detected

Using the Walltime instrument on standard Hosted Runners will lead to inconsistent data.

For the most accurate results, we recommend using CodSpeed Macro Runners: bare-metal machines fine-tuned for performance measurement consistency.

⚡ 3 improved benchmarks
❌ 1 regressed benchmark
✅ 2086 untouched benchmarks
🆕 261 new benchmarks
⏩ 206 skipped benchmarks1
🗄️ 4 archived benchmarks run2

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
Simulation cold_misaligned[(16, 64)] 345.8 µs 389.4 µs -11.21%
WallTime words_gather_scalar_avx2[65536] 9.4 µs 8.3 µs +13.22%
WallTime mul_u32_nonnull_avx512 6.3 µs 5.8 µs +10.23%
Simulation take_10_contiguous 52.4 µs 47.5 µs +10.12%
🆕 WallTime filter_neon[32] N/A 1.7 µs N/A
🆕 WallTime filter_neon[48] N/A 2.1 µs N/A
🆕 WallTime filter_neon[8] N/A 1.2 µs N/A
🆕 WallTime filter_neon[32] N/A 2 µs N/A
🆕 WallTime filter_neon[48] N/A 2.4 µs N/A
🆕 WallTime filter_neon[8] N/A 1.3 µs N/A
🆕 WallTime filter_neon[32] N/A 1.7 µs N/A
🆕 WallTime filter_neon[48] N/A 2.1 µs N/A
🆕 WallTime filter_neon[8] N/A 1.2 µs N/A
🆕 WallTime filter_neon[64] N/A 2.3 µs N/A
🆕 WallTime filter_neon[8] N/A 1.2 µs N/A
🆕 WallTime filter_neon[80] N/A 3 µs N/A
🆕 WallTime filter_neon[96] N/A 3.2 µs N/A
🆕 WallTime filter_neon[64] N/A 2.5 µs N/A
🆕 WallTime filter_neon[8] N/A 1.2 µs N/A
🆕 WallTime filter_neon[80] N/A 3.4 µs N/A
... ... ... ... ... ...

ℹ️ Only the first 20 benchmarks are displayed. Go to the app to view all benchmarks.

Tip

Investigate this regression by commenting @codspeedbot fix this regression on this PR, or directly use the CodSpeed MCP with your agent.


Comparing wm/fastlanes-sparse-extraction (9f1f51e) with develop (50cd6d7)

Open in CodSpeed

Footnotes

  1. 206 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.

  2. 4 benchmarks were run, but are now archived. If they were deleted in another branch, consider rebasing to remove them from the report. Instead if they were added back, click here to restore them.

@lwwmanning lwwmanning added the changelog/performance A performance improvement label Sep 1, 2026
@lwwmanning
lwwmanning marked this pull request as ready for review September 1, 2026 22:44
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Sep 1, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-09-01T22:47:10.916657Z 9f1f51e Draft marked ready
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changelog/performance A performance improvement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant