Skip to content

Pass --warmup along to pyperf #401

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jun 23, 2025
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