Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Fixes
  • Loading branch information
mdboom committed Jun 20, 2025
commit 7536c54375a19bd3119d672d6954247e6a77b074
2 changes: 1 addition & 1 deletion pyperformance/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ 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",
cmd.add_argument("--warmups", type=int, default=None,
help="number of skipped values per run used to warmup the benchmark")
filter_opts(cmd)

Expand Down
4 changes: 2 additions & 2 deletions pyperformance/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,7 @@ def get_pyperf_opts(options):
if options.hook:
for hook in options.hook:
opts.append('--hook=%s' % hook)
if options.warmup:
opts.append('--warmup=%s' % options.warmup)
if options.warmups is not None:
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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