Skip to content

Commit 9bd599a

Browse files
committed
[benchmark] Doctor explicitly measures memory
Small fix following the last refactorig of MAX_RSS, the `--memory` option is required to measure memory in `--verbose` mode. Added integration test for `check` command of Benchmark_Driver that depended on it.
1 parent 8b3b1f6 commit 9bd599a

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

benchmark/scripts/Benchmark_Driver

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,7 @@ class BenchmarkDoctor(object):
434434
measurements = dict(
435435
[('{0} {1} i{2}{3}'.format(benchmark, o, i, suffix),
436436
self.driver.run(benchmark, num_samples=s, num_iters=i,
437-
verbose=True))
437+
verbose=True, measure_memory=True))
438438
for o in opts
439439
for s, i in run_args
440440
for suffix in list('abcde')

benchmark/scripts/test_Benchmark_Driver.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -476,10 +476,10 @@ def test_measure_10_independent_1s_benchmark_series(self):
476476
# 5x i1 series, with 300 μs runtime its possible to take 4098
477477
# samples/s, but it should be capped at 2k
478478
([(_run('B1', num_samples=2048, num_iters=1,
479-
verbose=True), _PTR(min=300))] * 5) +
479+
verbose=True, measure_memory=True), _PTR(min=300))] * 5) +
480480
# 5x i2 series
481481
([(_run('B1', num_samples=2048, num_iters=2,
482-
verbose=True), _PTR(min=300))] * 5)
482+
verbose=True, measure_memory=True), _PTR(min=300))] * 5)
483483
))
484484
doctor = BenchmarkDoctor(self.args, driver)
485485
with captured_output() as (out, _):

test/benchmark/Benchmark_Driver.test-sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,7 @@
99
// RUN: | %FileCheck %s --check-prefix RUNJUSTONCE
1010
// RUNJUSTONCE-LABEL: Ackermann
1111
// RUNJUSTONCE-NOT: Ackermann
12+
13+
// RUN: %Benchmark_Driver check 1 \
14+
// RUN: | %FileCheck %s --check-prefix DOCTORCHECK
15+
// DOCTORCHECK: Ackermann

0 commit comments

Comments
 (0)