Skip to content

Commit 0efdd8d

Browse files
committed
[benchmark][Gardening] Nicer header composition
1 parent e3cbd18 commit 0efdd8d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

benchmark/utils/DriverUtils.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -439,10 +439,14 @@ func printRunInfo(_ c: TestConfig) {
439439
}
440440

441441
func runBenchmarks(_ c: TestConfig) {
442-
let units = "us"
443-
print("#\(c.delim)TEST\(c.delim)SAMPLES\(c.delim)MIN(\(units))\(c.delim)MAX(\(units))\(c.delim)MEAN(\(units))\(c.delim)SD(\(units))\(c.delim)MEDIAN(\(units))")
444442
var sumBenchResults = BenchResults()
445443
sumBenchResults.sampleCount = 0
444+
let withUnit = {$0 + "(us)"}
445+
let header = (
446+
["#", "TEST", "SAMPLES"] +
447+
["MIN", "MAX", "MEAN", "SD", "MEDIAN"].map(withUnit)
448+
).joined(separator: c.delim)
449+
print(header)
446450

447451
for t in c.tests {
448452
guard let results = runBench(t, c) else {

0 commit comments

Comments
 (0)