Skip to content

perf(array): reuse probe state in primitive and compressed arrays - #9844

Open
joseph-isaacs wants to merge 1 commit into
ji/array-probe-apifrom
ji/array-probe-encodings
Open

perf(array): reuse probe state in primitive and compressed arrays#9844
joseph-isaacs wants to merge 1 commit into
ji/array-probe-apifrom
ji/array-probe-encodings

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

Uses the scalar probe API from #9843 to retain preparation across repeated lookups, including recursive child access.

  • Primitive: unit local state; reads the value after shared validity checking.
  • FastLanes RLE: retains the slice base offset and probes for indices, offsets, and values.
  • RunEnd: retains ends and values child probes across binary-search comparisons and lookups.
  • PCO: retains validity, prefix ranks, page boundaries, and the most recently decoded page.
let mut probe = array.probe(ProbeUsage::Repeated);
probe.execute_scalar(10, &mut ctx)?;
probe.execute_scalar(11, &mut ctx)?; // Reuses preparation at each visited slot.

Includes nested RunEnd/PCO cache-reuse and drop tests, nullable/sliced access, lazy-validity regressions, an example, and scalar-probe benchmarks. The benchmark note labels older measurements as historical rather than results for the current implementation.

Validation: 3,925 crate tests passed (one skipped), array doctests, cargo +nightly fmt --all, Python Rust formatting, and cargo clippy --all-targets --all-features. The scalar-probe benchmark suite completed with short samples; this is not a controlled before/after performance comparison.

@codspeed-hq

codspeed-hq Bot commented Sep 11, 2026

Copy link
Copy Markdown

Merging this PR will regress 5 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.

⚡ 3 improved benchmarks
❌ 5 regressed benchmarks
✅ 2189 untouched benchmarks
🆕 64 new benchmarks
⏩ 218 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
WallTime filtered_owned_i64_avx2[OneNullInEight] 21.9 µs 25.8 µs -14.81%
Simulation is_valid_per_element[256] 103.5 µs 121.3 µs -14.66%
Simulation is_valid_per_element[1024] 401.5 µs 469.9 µs -14.54%
Simulation execute_scalar_struct_simple 106.4 µs 121.3 µs -12.24%
Simulation execute_scalar_struct_wide 502.9 µs 564.9 µs -10.97%
WallTime arrow_checked_add_u32_neon[16384] 20.3 µs 12.3 µs +65.25%
WallTime words_gather_scalar_avx2[65536] 9.4 µs 8.3 µs +13.3%
WallTime filtered_owned_i64_avx512[OneNullInEight] 26.6 µs 24 µs +10.52%
🆕 Simulation pco_execute_scalar[(1, false, false)] N/A 211.2 µs N/A
🆕 Simulation pco_execute_scalar[(1, true, false)] N/A 210.7 µs N/A
🆕 Simulation pco_execute_scalar[(1024, false, false)] N/A 132.8 ms N/A
🆕 Simulation pco_execute_scalar[(1024, false, true)] N/A 132.8 ms N/A
🆕 Simulation pco_execute_scalar[(1024, true, false)] N/A 101.6 ms N/A
🆕 Simulation pco_execute_scalar[(1024, true, true)] N/A 98.8 ms N/A
🆕 Simulation pco_execute_scalar[(64, false, false)] N/A 8.4 ms N/A
🆕 Simulation pco_execute_scalar[(64, false, true)] N/A 8.4 ms N/A
🆕 Simulation pco_execute_scalar[(64, true, false)] N/A 6.8 ms N/A
🆕 Simulation pco_execute_scalar[(64, true, true)] N/A 6.2 ms N/A
🆕 Simulation pco_probe[(1, false, false)] N/A 213.8 µs N/A
🆕 Simulation pco_probe[(1, true, false)] N/A 210.8 µ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 ji/array-probe-encodings (7c04bd8) with ji/array-probe-api (4eae754)

Open in CodSpeed

Footnotes

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

@joseph-isaacs
joseph-isaacs added this pull request to stack #9860 September 14, 2026 12:02
@joseph-isaacs
joseph-isaacs force-pushed the ji/array-probe-encodings branch from bfd3004 to c99df0f Compare September 14, 2026 13:26
@joseph-isaacs
joseph-isaacs force-pushed the ji/array-probe-encodings branch from c99df0f to 05146d3 Compare September 14, 2026 14:04
@joseph-isaacs joseph-isaacs added the changelog/performance A performance improvement label Sep 14, 2026
@joseph-isaacs
joseph-isaacs marked this pull request as ready for review September 14, 2026 14:04
Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
@joseph-isaacs
joseph-isaacs force-pushed the ji/array-probe-encodings branch 2 times, most recently from 05146d3 to 7c04bd8 Compare September 14, 2026 18:19
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