Skip to content

perf: push a prepared list_contains set into Dict and RunEnd needles - #10442

Open
robert3005 wants to merge 1 commit into
developfrom
rk/list-contains-dict-runend
Open

robert3005 wants to merge 1 commit into
developfrom
rk/list-contains-dict-runend

Conversation

@robert3005

@robert3005 robert3005 commented Oct 12, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Split out of #10052. list_contains of a prepared constant set over dictionary or run-end encoded needles probed every row. With this change, it probes once for each distinct value or run.

Changes

  • ListContainsElementReduce for Dict and RunEnd pushes the function into the values with a slice of the PreparedSetArray. This shares the one prepared set, so the set is not built again.
  • Off SQL null semantics, an empty set gives false for a null code. Thus the dictionary rule returns a constant false in that case.
  • Tests: the dictionary null-code cases (empty set and not empty, both null semantics), the push-down into dictionary values, and the push-down into run-end values.

🤖 Generated with Claude Code

@robert3005
robert3005 added this pull request to stack #10443 October 12, 2026 10:29
@codspeed

codspeed Bot commented Oct 12, 2026 •

Copy link
Copy Markdown

Merging this PR will regress 3 benchmarks

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

⚠️ 19 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

ℹ️ 40 benchmarks have no flame graph

The flamegraph could not be generated because we failed to resolve the symbols in the profiling trace. This happens when we fail to harvest information about language frames.

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

⚡ 5 improved benchmarks
❌ 3 regressed benchmarks
✅ 2251 untouched benchmarks

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ WallTime threshold_neon[8] 3.5 µs 4 µs -13.37%
❌ Simulation random_i8[0.01] 108 µs 122.9 µs -12.08%
❌ ℹ️ Simulation test_scan_filter[int] 3.1 ms 3.5 ms -11.14%
⚡ ⚠️ Simulation random_i128[0.01] 7.6 µs 6 µs +26.88%
⚡ WallTime filter_avx512[64] 2.5 µs 2.2 µs +15.67%
⚡ WallTime filter_neon[64] 3.4 µs 3 µs +14.04%
⚡ WallTime filter_neon[80] 3.6 µs 3.1 µs +13.32%
⚡ WallTime bitpack_blocked_compress_avx512 5.5 µs 4.8 µs +12.71%

Tip

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


Comparing rk/list-contains-dict-runend (26a71c9) with develop (c1a2ca1)

Open in CodSpeed

@robert3005
robert3005 force-pushed the claude/friendly-knuth-dj6ed1-list-contains branch from e86b215 to 4bb2b50 Compare October 14, 2026 17:30
@robert3005
robert3005 force-pushed the rk/list-contains-dict-runend branch from 520e97b to 59aa869 Compare October 14, 2026 17:32
@robert3005 robert3005 added the changelog/performance A performance improvement label Oct 14, 2026
@robert3005
robert3005 marked this pull request as ready for review October 14, 2026 17:45
Base automatically changed from claude/friendly-knuth-dj6ed1-list-contains to develop October 14, 2026 18:26
@robert3005
robert3005 force-pushed the rk/list-contains-dict-runend branch from 59aa869 to a6758cb Compare October 14, 2026 18:26
@robert3005
robert3005 removed this pull request from stack #10443 October 14, 2026 18:35
`list_contains` of a prepared constant set over dictionary or run-end
encoded needles probed every row. Reduce rules for `Dict` and `RunEnd`
now push the function into their values with a slice of the prepared
set, so the set is probed once per distinct value or run and the shared
set is not built again.

Off SQL null semantics, an empty set answers `false` for a null code, so
the dictionary rule returns a constant `false` in that case.

Signed-off-by: Robert Kruszewski <robert@spiraldb.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Robert Kruszewski <github@robertk.io>
@robert3005
robert3005 force-pushed the rk/list-contains-dict-runend branch from a6758cb to 26a71c9 Compare October 15, 2026 11:49

This branch has not been deployed

No deployments
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