Skip to content

perf(array): snapshot aggregate kernels in ExecutionCtx - #10561

Merged
robert3005 merged 1 commit into
developfrom
ji/vibrant-ritchie-0ct678
Oct 19, 2026
Merged

robert3005 merged 1 commit into
developfrom
ji/vibrant-ritchie-0ct678

Conversation

@joseph-isaacs

@joseph-isaacs joseph-isaacs commented Oct 16, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Aggregate accumulators look up AggregateFnSession on every batch and on every pass of their execute loop. The grouped accumulator does two lookups per pass. Each lookup loads the session map, does two TypeId lookups and then loads the registry. This PR snapshots the aggregate kernel registries into the ExecutionCtx on first use, the same way execute-parent kernels are already snapshotted, so those lookups only read a plain HashMap.

This follows the idea in #10541, which avoids an unused session lookup.

@codspeed

codspeed Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Merging this PR will degrade performance by 13.1%

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

⚠️ 1 benchmark measured no execution time

Nothing ran under measurement, usually because the compiler removed the code under test. This result is not comparable, so it counts as unchanged.

Preventing compiler optimizations

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

❌ 6 regressed benchmarks
✅ 2402 untouched benchmarks
⏩ 12 skipped benchmarks1

Warning

Please fix the performance issues or acknowledge them on CodSpeed.

Performance Changes

Mode Benchmark BASE HEAD Efficiency
❌ ⚠️ Simulation random_i128[0.01] 4.8 µs 6 µs -19.42%
❌ Simulation random_i8[0.01] 101.3 µs 117 µs -13.46%
❌ WallTime starts_with_avx2[64, VarBin] 53.3 µs 60.4 µs -11.75%
❌ WallTime bitpack_blocked_compress_avx2 6.7 µs 7.6 µs -11.5%
❌ ℹ️ Simulation test_scan_filter[int] 3.1 ms 3.5 ms -11.15%
❌ Simulation isolated_runs[u32, (16, 0)] 78.5 µs 88.2 µs -10.97%

Tip

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


Comparing ji/vibrant-ritchie-0ct678 (2a2cde3) with develop (5d8fa18)

Open in CodSpeed

Footnotes

  1. 12 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. ↩

Aggregate accumulators looked up `AggregateFnSession` on every batch and on
every iteration of their execute loop, paying a session arc-swap load, two
type-map lookups and a registry load each time. Snapshot the aggregate,
grouped and grouped-encoding kernel registries into the `ExecutionCtx` on
first use, mirroring the execute-parent kernel snapshot, and dispatch through
it.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GjnvCm6kT6P79iEBaHshSN
@robert3005
robert3005 force-pushed the ji/vibrant-ritchie-0ct678 branch from d89f064 to 2a2cde3 Compare October 19, 2026 18:52
@robert3005 robert3005 added the changelog/performance A performance improvement label Oct 19, 2026
@robert3005
robert3005 merged commit 3ded4dd into develop Oct 19, 2026
114 of 116 checks passed
@robert3005
robert3005 deleted the ji/vibrant-ritchie-0ct678 branch October 19, 2026 19:16
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.

2 participants