Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions pyperformance/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ def parse_args():
choices=hook_names,
metavar=f"{', '.join(x for x in hook_names if not x.startswith('_'))}",
help="Apply the given pyperf hook(s) when running each benchmark")
cmd.add_argument("--warmups", type=int, default=None,
help="number of skipped values per run used to warmup the benchmark")
filter_opts(cmd)

# show
Expand Down
2 changes: 2 additions & 0 deletions pyperformance/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,5 +247,7 @@ def get_pyperf_opts(options):
if options.hook:
for hook in options.hook:
opts.append('--hook=%s' % hook)
if options.warmups is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if options.warmups is not None:
if options.warmups:

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also need to be able to pass --warmups 0 explicitly when that is specified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah got it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you leave the comment for it?

opts.append('--warmups=%s' % options.warmups)

return opts
Loading