Skip to content

Commit 07c0e2a

Browse files
authored
Merge pull request #27662 from eeckstein/run-smoke-bench
run_smoke_bench: make num_retries configurable
2 parents 36c5c2f + 81a5c0f commit 07c0e2a

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

benchmark/scripts/run_smoke_bench

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,10 @@ def main():
9393
argparser.add_argument(
9494
'-num-samples', type=int,
9595
help='The (minimum) number of samples to run', default=3)
96+
argparser.add_argument(
97+
'-num-reruns', type=int,
98+
help="The number of re-runs until it's assumed to be a real change",
99+
default=8)
96100
argparser.add_argument(
97101
'-platform', type=str,
98102
help='The benchmark build platform', default='macosx')
@@ -120,7 +124,7 @@ def test_opt_levels(args):
120124
if test_performance(opt_level, args.oldbuilddir[0],
121125
args.newbuilddir[0],
122126
float(args.threshold) / 100, args.num_samples,
123-
output_file):
127+
args.num_reruns, output_file):
124128
changes = True
125129

126130
# There is no point in reporting code size for Onone.
@@ -171,7 +175,7 @@ def merge(results, other_results):
171175

172176

173177
def test_performance(opt_level, old_dir, new_dir, threshold, num_samples,
174-
output_file):
178+
num_reruns, output_file):
175179
"""Detect performance changes in benchmarks.
176180
177181
Start fast with few samples per benchmark and gradually spend more time
@@ -185,7 +189,7 @@ def test_performance(opt_level, old_dir, new_dir, threshold, num_samples,
185189
tests = TestComparator(results[0], results[1], threshold)
186190
changed = tests.decreased + tests.increased
187191

188-
while len(changed) > 0 and unchanged_length_count < 10:
192+
while len(changed) > 0 and unchanged_length_count < num_reruns:
189193
i += 1
190194
if VERBOSE:
191195
log(' test again: ' + str([test.name for test in changed]))

0 commit comments

Comments
 (0)