Skip to content

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

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

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

Conversation

@lwwmanning

@lwwmanning lwwmanning commented Aug 27, 2026

Copy link
Copy Markdown
Contributor

Speed up constant integer list membership for Primitive, FastLanes BitPacked, and Sequence arrays. Vortex previously expanded value IN (...) into one equality per member, then combined the results. That process often scans the data once per member. Lists with one to four source members now use one direct pass. FastLanes checks each value as it unpacks a block, so it avoids a full decoded array. Sequence arrays answer from encoded sequence metadata. Lists with five or more members keep the generic expression path. Local benchmarks did not justify the more complex lookup-table, binary-search, or decode-once paths.

The parent adaptor resolves null and empty constant lists before an encoding-specific kernel runs. DataFusion and DuckDB also retain empty or null-bearing IN and NOT IN expressions. DataFusion retains those expressions in projections too. These safeguards preserve SQL null behavior.

Representative u32 results from a local arm64 Mac:

Path Generic baseline This PR Speedup
Primitive, four members 34.66 µs 9.71 µs 3.6×
BitPacked, four members 27.12 µs 12.16 µs 2.2×
BitPacked with patches, four members 32.37 µs 12.79 µs 2.5×
BitPacked fallback, five members 33.66 µs 32.95 µs 1.0×

Permanent CodSpeed benchmarks cover all four unsigned integer widths, the four-to-five-member boundary, short arrays, wide bit widths, and patched arrays.

🤖 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.26%

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

⚡ 4 improved benchmarks
❌ 25 regressed benchmarks
✅ 2061 untouched benchmarks
🆕 168 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.02%
Simulation filter_powerlaw_by_mostly_true[250000] 185.7 µs 216.3 µs -14.15%
Simulation filter_random_by_mostly_true[250000] 185.7 µs 216.3 µs -14.13%
Simulation filter_random_by_random[250000] 170 µs 194.3 µs -12.49%
Simulation filter_powerlaw_by_random[250000] 170.1 µs 194.4 µs -12.48%
Simulation density_sweep_random[0.9] 91.8 µs 104.4 µs -12.07%
Simulation filter_random_by_mostly_true[100000] 92.4 µs 105 µs -12.05%
Simulation filter_powerlaw_by_mostly_true[100000] 92.8 µs 105.5 µs -12.04%
Simulation density_sweep_random[0.95] 92.3 µs 104.9 µs -11.98%
Simulation density_sweep_dense_runs[0.9] 91.7 µs 104.2 µs -11.93%
Simulation density_sweep_dense_runs[0.95] 92.5 µs 104.9 µs -11.85%
Simulation filter_random_by_power_law[250000] 160.3 µs 179.9 µs -10.94%
Simulation filter_powerlaw_by_power_law[250000] 160.5 µs 180.2 µs -10.93%
Simulation filter_random_by_random[100000] 86.3 µs 96.4 µs -10.55%
Simulation density_sweep_random[0.5] 85.7 µs 95.8 µs -10.55%
Simulation density_sweep_dense_runs[0.5] 86.4 µs 96.6 µs -10.52%
Simulation filter_powerlaw_by_random[100000] 86.4 µs 96.5 µs -10.49%
Simulation filter_powerlaw_by_mostly_false[250000] 155.8 µs 173.9 µs -10.41%
Simulation filter_random_by_mostly_false[250000] 155.7 µs 173.7 µs -10.37%
Simulation density_sweep_dense_runs[0.02] 84.8 µs 94.4 µs -10.2%
... ... ... ... ... ...

ℹ️ 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 (1297896) with develop (e3923a5)

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>
Signed-off-by: Will Manning <will@willmanning.io>
Keep direct Primitive and FastLanes membership at one to four source members. Preserve the generic expression path beyond that measured boundary.

Add fair generic baselines and retain unsafe IN expressions in DataFusion and DuckDB.

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