Skip to content

perf(fastlanes): Evaluate constant list membership - #9682

Draft
lwwmanning wants to merge 7 commits into
developfrom
wm/fastlanes-list-contains
Draft

perf(fastlanes): Evaluate constant list membership#9682
lwwmanning wants to merge 7 commits into
developfrom
wm/fastlanes-list-contains

Conversation

@lwwmanning

@lwwmanning lwwmanning commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Evaluate constant integer list membership directly against BitPacked arrays. Lists with one to four members use fused comparisons. Larger lists with spans up to 4 KiB use a byte lookup table during FastLanes unpack. Wider spans decode once and reuse the prepared sorted membership plan. A Primitive kernel provides the optimized canonical fallback. Empty lists return false for null needles. Non-empty lists preserve needle validity, and null lists return null.

Local benchmarks cover 64, 1,024, and 65,536 values across 1, 4, 8, 32, and 64 list members. Compressed execution was 21–54% faster than canonical fallback. Tables near the 4 KiB cap were 20–35% faster. Wide sparse sets were 10–16% faster at 1,024 rows and stayed within 1% at 65,536 rows.

🤖 Generated with Codex

Signed-off-by: Will Manning <will@willmanning.io>
@codspeed-hq

codspeed-hq Bot commented Aug 27, 2026

Copy link
Copy Markdown

Merging this PR will degrade performance by 8.8%

⚠️ 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
❌ 15 regressed benchmarks
✅ 2072 untouched benchmarks
🆕 141 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
WallTime arrow_checked_add_u32_neon[16384] 13.4 µs 20.3 µs -34.04%
Simulation filter_powerlaw_by_mostly_true[250000] 186.1 µs 215.9 µs -13.79%
Simulation filter_random_by_mostly_true[250000] 186.2 µs 215.9 µs -13.77%
Simulation filter_random_by_random[250000] 170.4 µs 193.9 µs -12.11%
Simulation filter_powerlaw_by_random[250000] 170.5 µs 194 µs -12.11%
Simulation density_sweep_random[0.9] 92 µs 104 µs -11.47%
Simulation filter_powerlaw_by_mostly_true[100000] 93.2 µs 105.1 µs -11.35%
Simulation filter_random_by_mostly_true[100000] 92.8 µs 104.6 µs -11.34%
Simulation density_sweep_random[0.95] 92.6 µs 104.5 µs -11.33%
Simulation density_sweep_dense_runs[0.9] 92.1 µs 103.8 µs -11.28%
Simulation density_sweep_dense_runs[0.95] 92.8 µs 104.5 µs -11.18%
Simulation filter_powerlaw_by_power_law[250000] 160.9 µs 179.8 µs -10.48%
Simulation filter_random_by_power_law[250000] 160.8 µs 179.5 µs -10.47%
WallTime mul_i32_nonnull_avx512 7.1 µs 8 µs -10.45%
WallTime mul_u32_nonnull_avx512 5.7 µs 6.3 µs -10.41%
WallTime arrow_checked_add_u32_avx512[16384] 21.4 µs 17.7 µs +21.02%
WallTime arrow_checked_add_u32_avx2[16384] 21.3 µs 17.7 µs +20.4%
Simulation compress_fsst[(500, 64, 4)] 488.3 µs 442.2 µs +10.43%
🆕 WallTime packed_current_neon[decode_u16_m25_u16_w8_n65536] N/A 373.6 µs N/A
🆕 WallTime packed_current_neon[decode_u32_m13_u32_w8_n65536] N/A 249.9 µ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-list-contains (cc5bbc0) with develop (eff83d4)

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.

Signed-off-by: Will Manning <will@willmanning.io>
@lwwmanning lwwmanning added the changelog/performance A performance improvement label Aug 28, 2026
Signed-off-by: Will Manning <will@willmanning.io>
…contains

Signed-off-by: Will Manning <will@willmanning.io>
Signed-off-by: Will Manning <will@willmanning.io>
…contains

Signed-off-by: Will Manning <will@willmanning.io>
Signed-off-by: Will Manning <will@willmanning.io>
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