Skip to content

bench: warm ArrayKernels before the bench loop#8479

Open
joseph-isaacs wants to merge 1 commit into
developfrom
claude/blissful-bohr-aynoba
Open

bench: warm ArrayKernels before the bench loop#8479
joseph-isaacs wants to merge 1 commit into
developfrom
claude/blissful-bohr-aynoba

Conversation

@joseph-isaacs

Copy link
Copy Markdown
Contributor

Add a test_harness-only WarmKernelsExt trait whose warm_kernels calls
get::<ArrayKernels>(), and invoke it before divan::main() in the
benchmarks so the one-time session-variable insertion happens during setup
rather than inside the first measured iteration (which matters under
CodSpeed's instruction-count simulation).

Benches gated behind #[cfg(not(codspeed))] are CodSpeed-excluded and left
unchanged. The two vortex-crate benches warm via a direct
get::<ArrayKernels>() because they do not enable the _test-harness
feature needed to reach the trait.

Signed-off-by: Joe Isaacs joe.isaacs@live.co.uk
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01FtbtDsKWsbX6eEhCEoqPWD

Add a test_harness-only `WarmKernelsExt` trait whose `warm_kernels` calls
`get::<ArrayKernels>()`, and invoke it before `divan::main()` in the
benchmarks so the one-time session-variable insertion happens during setup
rather than inside the first measured iteration (which matters under
CodSpeed's instruction-count simulation).

Benches gated behind `#[cfg(not(codspeed))]` are CodSpeed-excluded and left
unchanged. The two `vortex`-crate benches warm via a direct
`get::<ArrayKernels>()` because they do not enable the `_test-harness`
feature needed to reach the trait.

Signed-off-by: Joe Isaacs <joe.isaacs@live.co.uk>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FtbtDsKWsbX6eEhCEoqPWD
@joseph-isaacs joseph-isaacs requested a review from a team June 17, 2026 16:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants