Repository navigation
Read the units BenchmarkDotNet writes into the CSV cells - #44
Merged
FlorianRappl merged 1 commit intoNov 2, 2026
Merged
Conversation
Write-Summary stripped everything but digits and dots from the Mean and Allocated cells and read them as ns and B. BenchmarkDotNet writes the unit into each cell and picks it per row (952.654 us, 1,280.41 KB), so such rows were off by 1000x or 1024x, and a ratio was wrong whenever two builds of a case landed in different units. Each cell is now parsed as a value and a unit (ns, us with the Greek mu, the micro sign or u, ms, s; B, KB, MB, GB) and converted; NA (a failed benchmark) drops the row, - counts as no allocation, and an unknown unit throws. Reports are only read from this run's round-* folders, as a report left in a baseline source tree would otherwise count as a build. On the reports of an earlier three-way run the summary is unchanged; with one build's cells rewritten into us/ms and KB/MB it matches up to the rounding of the rewritten values, where the previous parsing got 20 of 24 rows wrong.
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.
Compare-Builds.ps1misread the BenchmarkDotNet CSV reports, sosummary.mdcould be wrong.Problem
Write-Summarystripped everything but digits and dots from theMeanandAllocatedcells, then read them as ns and B. BenchmarkDotNet writes the unit into each cell and picks it per row (952.654 μs,1,280.41 KB). So:Change
ns,μs/µs/us,ms,s. Sizes:B,KB,MB,GB.NA(a failed benchmark) drops the row.-counts as no allocation.round-*folders. The baseline source trees live in the output directory too, and a report left in one of them would otherwise count as a build.Verification
No benchmark run was needed: the script's functions were tested directly.
-; an unknown unit is rejected.summary.mdis identical to the original, even with a stray report in a source tree.μs/msandKB/MB, the summary matches up to the rounding of the rewritten values. The previous parsing got 20 of 24 rows wrong; for example, 5.53 ms showed as "5.5 ns" with ratio 0.000.🤖 Generated with Claude Code