Repository navigation
Export only overhead Actual iterations in PerfLabExporter - #5369
Open
LoopedBard3 wants to merge 1 commit into
Open
LoopedBard3 wants to merge 1 commit into
LoopedBard3 wants to merge 1 commit into
Conversation
The Overhead invocation counter previously included OverheadWarmup measurements and, because measurements were ordered only by launch and iteration index, interleaved warmup and actual values. Restrict it to IterationMode.Overhead with IterationStage.Actual, matching what BenchmarkDotNet subtracts for Result. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
There are no active review issues for the change excluding warmup measurements from the overhead export.
No open issues 🎉
What changed in this PR
This PR corrects the benchmark harness’s Overhead invocation export by including only actual overhead measurements, preventing warmup values from being interleaved with them.
Changes:
- Filters overhead measurements to
IterationMode.OverheadandIterationStage.Actual. - Preserves launch/iteration ordering, the counter name, and all other counters.
| File | Description |
|---|---|
| src/harness/BenchmarkDotNet.Extensions/PerfLabExporter.cs | Restricts exported overhead values to actual iterations, excluding warmup measurements. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Agent assessment
Self-reported assessment, not an independent review.
Assessed revision:
5ee791861b9c71634dc76d423db2df9d3780f407↑ Against the saved Viper report, the new filter selects exactly the 20 OverheadActual values in order.
↓ No lab run or unit test exercises the exporter end to end.
↓ Downstream consumers of the
Overhead invocationarray will see fewer values per run.↓ Verified on one benchmark/run; warmup counts vary per benchmark.
Summary
The
Overhead invocationcounter inPerfLabExporterselectedresult.IsOverhead() && result.IterationStage != Jitting, so it included bothOverheadWarmupandOverheadActual. The query sorted only byLaunchIndex, IterationIndex. Both stages start their index at 1, so warmup and actual values were interleaved in the exported array.This change keeps only
IterationMode.OverheadwithIterationStage.Actual. Those are the overhead measurements that BenchmarkDotNet subtracts to getResult. The counter name and all other counters stay the same.Evidence (Viper WASM, r2r_composite)
dotnet-runtime-perf20261129.4), Helix job98583ffc-f641-4f6f-817b-ec7c512cdfa6, work itemwasm.x64.micro.net12.0.Partition12(Pass), queueUbuntu.2204.Amd64.Viper.Perf,PERFLAB_EVALUATE_OVERHEAD=1.94e617d1f(current main). BDN0.16.0-nightly.20261029.662.System.Runtime.Intrinsics.Tests.Perf_Vector128Of<UInt32>.InequalityOperatorBenchmark, launch 1/1: 9 OverheadWarmup + 20 OverheadActual. All 29 normalized values are distinct.W1..W9, A1..A20.Measurements.TestCounterResultsstore them asW1, A1, W2, A2, …, W9, A9, A10, …, A20. All 29 values match index-for-index after normalizing ns/op.After this change, the array for this test would contain only A1..A20.
Validation
dotnet build src\harness\BenchmarkDotNet.Extensions\BenchmarkDotNet.Extensions.csproj -c Release: passed (0 warnings, 0 errors).