Allow passing --runs to hyperfine in the benchmarking harness (#19485)

## Summary

hyperfine complains if both `--min-runs` and `--runs` are passed so
`--min-runs` should be conditionally default.

## Test Plan

Manual testing.
This commit is contained in:
Tomasz Kramkowski
2026-05-20 19:32:53 +01:00
committed by GitHub
parent 78d8fe93c7
commit 14f72061d3
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -1289,7 +1289,6 @@ def main():
"--min-runs",
type=int,
help="The minimum number of runs to perform.",
default=10,
)
parser.add_argument(
"--runs",
@@ -1382,8 +1381,11 @@ def main():
json = args.json
python = args.python
warmup = args.warmup
min_runs = args.min_runs
runs = args.runs
min_runs = args.min_runs
# --min-runs and --runs conflict
if runs is None and min_runs is None:
min_runs = 10
requirements_file = os.path.abspath(args.file)
if not os.path.exists(requirements_file):
+4 -2
View File
@@ -243,7 +243,6 @@ def main():
"--min-runs",
type=int,
help="The minimum number of runs to perform.",
default=10,
)
parser.add_argument(
"--runs",
@@ -291,8 +290,11 @@ def main():
verbose = args.verbose
json = args.json
warmup = args.warmup
min_runs = args.min_runs
runs = args.runs
min_runs = args.min_runs
# --min-runs and --runs conflict
if runs is None and min_runs is None:
min_runs = 10
# Determine the tools to benchmark, based on the user-provided arguments.
suites = []