Skip to content

Commit a05e6bc

Browse files
authored
Merge pull request #20826 from palimondo/against-the-dark
[benchmark] Small Driver Tweaks
2 parents 8a27e89 + 0bdd3ef commit a05e6bc

File tree

1 file changed

+18
-17
lines changed

1 file changed

+18
-17
lines changed

benchmark/utils/DriverUtils.swift

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -198,23 +198,24 @@ struct TestConfig {
198198
""")
199199
}
200200

201-
if verbose {
202-
let testList = tests.map({ $0.1.name }).joined(separator: ", ")
203-
print("""
204-
--- CONFIG ---
205-
NumSamples: \(numSamples ?? 0)
206-
Verbose: \(verbose)
207-
LogMemory: \(logMemory)
208-
SampleTime: \(sampleTime)
209-
NumIters: \(numIters ?? 0)
210-
Quantile: \(quantile ?? 0)
211-
Delimiter: \(String(reflecting: delim))
212-
Tests Filter: \(c.tests ?? [])
213-
Tests to run: \(testList)
214-
215-
--- DATA ---\n
216-
""")
217-
}
201+
// We always prepare the configuration string and call the print to have
202+
// the same memory usage baseline between verbose and normal mode.
203+
let testList = tests.map({ $0.1.name }).joined(separator: ", ")
204+
let configuration = """
205+
--- CONFIG ---
206+
NumSamples: \(numSamples ?? 0)
207+
Verbose: \(verbose)
208+
LogMemory: \(logMemory)
209+
SampleTime: \(sampleTime)
210+
NumIters: \(numIters ?? 0)
211+
Quantile: \(quantile ?? 0)
212+
Delimiter: \(String(reflecting: delim))
213+
Tests Filter: \(c.tests ?? [])
214+
Tests to run: \(testList)
215+
216+
--- DATA ---\n
217+
"""
218+
print(verbose ? configuration : "", terminator:"")
218219
}
219220

220221
/// Returns the list of tests to run.

0 commit comments

Comments
 (0)