Skip to content

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

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

perf(fastlanes): Evaluate constant list membership#9682
lwwmanning wants to merge 2 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 5.63%

⚠️ 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.

⚠️ Different runtime environments detected

Some benchmarks with significant performance changes were compared across different runtime environments,
which may affect the accuracy of the results.

Open the report in CodSpeed to investigate

⚡ 7 improved benchmarks
❌ 17 regressed benchmarks
✅ 2145 untouched benchmarks
🆕 50 new benchmarks
⏩ 106 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.5 µs 20.3 µs -33.75%
WallTime mul_u64_nonnull_neon 15.1 µs 20 µs -24.62%
WallTime mul_i64_nonnull_neon 17.1 µs 20 µs -14.76%
WallTime multiply_shapes_neon[(16384, PerRowPerRow)] 17.3 µs 20.2 µs -14.32%
Simulation filter_powerlaw_by_mostly_true[250000] 186.5 µs 215.9 µs -13.6%
Simulation filter_random_by_mostly_true[250000] 186.6 µs 215.9 µs -13.57%
Simulation compress_fsst[(500, 64, 8)] 475.1 µs 541.5 µs -12.26%
Simulation filter_powerlaw_by_random[250000] 170.9 µs 194 µs -11.91%
Simulation filter_random_by_random[250000] 170.8 µs 193.9 µs -11.89%
Simulation density_sweep_random[0.9] 92.5 µs 104 µs -11.11%
Simulation filter_powerlaw_by_mostly_true[100000] 93.6 µs 105.2 µs -10.99%
Simulation filter_random_by_mostly_true[100000] 93.2 µs 104.7 µs -10.97%
Simulation density_sweep_random[0.95] 93.1 µs 104.5 µs -10.92%
Simulation density_sweep_dense_runs[0.9] 92.5 µs 103.8 µs -10.88%
Simulation density_sweep_dense_runs[0.95] 93.3 µs 104.5 µs -10.77%
Simulation filter_powerlaw_by_power_law[250000] 161.4 µs 179.7 µs -10.19%
Simulation filter_random_by_power_law[250000] 161.2 µs 179.4 µs -10.18%
Simulation compact_sliced[(2048, 10)] 251.4 µs 180.9 µs +38.96%
Simulation compact_sliced[(1024, 10)] 149.7 µs 114.3 µs +30.9%
WallTime arrow_checked_add_u32_avx512[16384] 21.3 µs 17.7 µs +20.4%
... ... ... ... ... ...

ℹ️ 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 (4c49d32) with develop (01f147a)

Open in CodSpeed

Footnotes

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