Skip to content

Commit c3a7274

Browse files
committed
Make --num-samples actually work
1 parent 5c14017 commit c3a7274

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

benchmark/scripts/run_smoke_bench

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,12 +204,12 @@ def test_opt_levels(args):
204204
return 0
205205

206206

207-
def measure(driver, tests, i):
207+
def measure(driver, tests, i, min_num_samples):
208208
"""Log and measure samples of the tests with the given driver.
209209
210210
Collect increasing number of samples, depending on the iteration.
211211
"""
212-
num_samples = min(i + 3, 10)
212+
num_samples = max(min(i + 3, 10), min_num_samples)
213213
msg = " Iteration {0} for {1}: num samples = {2}, ".format(
214214
i, driver.args.tests, num_samples
215215
)
@@ -246,7 +246,7 @@ def test_performance(
246246
optimization=opt_level))
247247
for dir in [old_dir, new_dir]
248248
]
249-
results = [measure(driver, driver.tests, i) for driver in [old, new]]
249+
results = [measure(driver, driver.tests, i, num_samples) for driver in [old, new]]
250250
tests = TestComparator(results[0], results[1], threshold)
251251
changed = tests.decreased + tests.increased
252252

@@ -255,7 +255,7 @@ def test_performance(
255255
if VERBOSE:
256256
log(" test again: " + str([test.name for test in changed]))
257257
results = [
258-
merge(the_results, measure(driver, [test.name for test in changed], i))
258+
merge(the_results, measure(driver, [test.name for test in changed], i, num_samples))
259259
for the_results, driver in zip(results, [old, new])
260260
]
261261
tests = TestComparator(results[0], results[1], threshold)

0 commit comments

Comments
 (0)