Skip to content

Commit 29cd683

Browse files
authored
Pass --warmup along to pyperf (#401)
* Pass --warmup along to pyperf * Fixes * Add comment about --warmups 0
1 parent ec9e291 commit 29cd683

File tree

2 files changed

+5
-0
lines changed

2 files changed

+5
-0
lines changed

pyperformance/cli.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ def parse_args():
101101
choices=hook_names,
102102
metavar=f"{', '.join(x for x in hook_names if not x.startswith('_'))}",
103103
help="Apply the given pyperf hook(s) when running each benchmark")
104+
cmd.add_argument("--warmups", type=int, default=None,
105+
help="number of skipped values per run used to warmup the benchmark")
104106
filter_opts(cmd)
105107

106108
# show

pyperformance/run.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -247,5 +247,8 @@ def get_pyperf_opts(options):
247247
if options.hook:
248248
for hook in options.hook:
249249
opts.append('--hook=%s' % hook)
250+
# --warmups=0 is a valid option, so check for `not None` here
251+
if options.warmups is not None:
252+
opts.append('--warmups=%s' % options.warmups)
250253

251254
return opts

0 commit comments

Comments
 (0)