Skip to content

Commit c7fc745

Browse files
committed
[benchmark] Removed bogus Totals stats
Report only the total number of executed tests. Aggregating MIN, MAX and MEAN values for all executed benchmarks together (with microsecond precision!) has no statistical relevance.
1 parent 0efdd8d commit c7fc745

File tree

1 file changed

+4
-11
lines changed

1 file changed

+4
-11
lines changed

benchmark/utils/DriverUtils.swift

Lines changed: 4 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -439,15 +439,15 @@ func printRunInfo(_ c: TestConfig) {
439439
}
440440

441441
func runBenchmarks(_ c: TestConfig) {
442-
var sumBenchResults = BenchResults()
443-
sumBenchResults.sampleCount = 0
444442
let withUnit = {$0 + "(us)"}
445443
let header = (
446444
["#", "TEST", "SAMPLES"] +
447445
["MIN", "MAX", "MEAN", "SD", "MEDIAN"].map(withUnit)
448446
).joined(separator: c.delim)
449447
print(header)
450448

449+
var testCount = 0
450+
451451
for t in c.tests {
452452
guard let results = runBench(t, c) else {
453453
print("\(t.index)\(c.delim)\(t.name)\(c.delim)Unsupported")
@@ -457,18 +457,11 @@ func runBenchmarks(_ c: TestConfig) {
457457
print("\(t.index)\(c.delim)\(t.name)\(c.delim)\(results.description)")
458458
fflush(stdout)
459459

460-
sumBenchResults.min += results.min
461-
sumBenchResults.max += results.max
462-
sumBenchResults.mean += results.mean
463-
sumBenchResults.sampleCount += 1
464-
// Don't accumulate SD and Median, as simple sum isn't valid for them.
465-
// TODO: Compute SD and Median for total results as well.
466-
// sumBenchResults.sd += results.sd
467-
// sumBenchResults.median += results.median
460+
testCount += 1
468461
}
469462

470463
print("")
471-
print("Totals\(c.delim)\(sumBenchResults.description)")
464+
print("Totals\(c.delim)\(testCount)")
472465
}
473466

474467
public func main() {

0 commit comments

Comments
 (0)