Repository navigation
Commit 01928f3
committed
Write the benchmark history tool in C# rather than Python [patch]
The tool that reads BenchmarkDotNet's reports and draws the chart was Python,
which fits none of these repositories: there is no other .py file in
PreciseNumber, Semantics or SignificantNumber, and what scripting they do have is
PowerShell. It was chosen because it was quick to write and needs nothing
installed on a runner, which is a reason about writing it rather than about
living with it — and it was about to be copied into two more repositories.
It is now a .NET 10 file-based app, run as
dotnet run scripts/benchmark-history.cs -- ingest ...
so it needs no project, no runtime beyond the SDK that already builds the
library, and no second language in the workflow. A third subcommand, baseline,
replaces the inline Python that read one number back out of a report.
The build covers it, which is the part that could not be had before: the first
compile failed on CA1305, CA1502, CA1505, CA1506, IL2026, IL3050 and SYSLIB1045.
Most are fixed rather than suppressed — cultures are explicit, the regex is
source-generated, and the work moved out of top-level statements into a class so
the analyzers judge each method rather than one 500-line Main.
The port is verified by output rather than by reading: re-ingesting the same
reports and re-rendering leaves both the history and the two SVGs byte for byte
identical to what Python produced. Getting there caught one real difference —
parameters were coming out in ordinal order, which reads 200, 30, 8, where
BenchmarkDotNet declares them 8, 30, 200 and the Digits axis is meant to be read
across in order.
Also drops the .gitignore entries added with the workflow. ktsu.Sdk regenerates
that file on every build, so they did not survive one — which is what quietly ate
them twice while this was being written. The scratch output goes to
BenchmarkDotNet.Artifacts/ instead, already ignored, and worktrees are created
under RUNNER_TEMP, outside the repository where the commit step cannot see them.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_017jrnV7N94UGL8fDRRE8Xt81 parent 671f1d4 commit 01928f3
3 files changed
Lines changed: 615 additions & 481 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
42 | 44 | | |
43 | 45 | | |
44 | 46 | | |
| |||
87 | 89 | | |
88 | 90 | | |
89 | 91 | | |
90 | | - | |
91 | | - | |
92 | | - | |
93 | | - | |
94 | | - | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
| 92 | + | |
| 93 | + | |
99 | 94 | | |
100 | 95 | | |
101 | 96 | | |
| |||
107 | 102 | | |
108 | 103 | | |
109 | 104 | | |
110 | | - | |
| 105 | + | |
111 | 106 | | |
112 | 107 | | |
113 | 108 | | |
114 | 109 | | |
115 | 110 | | |
116 | | - | |
| 111 | + | |
117 | 112 | | |
118 | | - | |
| 113 | + | |
119 | 114 | | |
120 | | - | |
| 115 | + | |
121 | 116 | | |
122 | 117 | | |
123 | 118 | | |
| |||
141 | 136 | | |
142 | 137 | | |
143 | 138 | | |
144 | | - | |
| 139 | + | |
145 | 140 | | |
146 | 141 | | |
147 | 142 | | |
| |||
159 | 154 | | |
160 | 155 | | |
161 | 156 | | |
162 | | - | |
| 157 | + | |
163 | 158 | | |
164 | | - | |
| 159 | + | |
165 | 160 | | |
166 | | - | |
| 161 | + | |
167 | 162 | | |
168 | 163 | | |
169 | 164 | | |
| |||
176 | 171 | | |
177 | 172 | | |
178 | 173 | | |
179 | | - | |
| 174 | + | |
180 | 175 | | |
181 | 176 | | |
182 | 177 | | |
| |||
204 | 199 | | |
205 | 200 | | |
206 | 201 | | |
207 | | - | |
| 202 | + | |
208 | 203 | | |
209 | 204 | | |
0 commit comments