Skip to content

Commit 2ecdf31

Browse files
committed
docs: document benchmark_min_time CLI forms
1 parent 7e413be commit 2ecdf31

3 files changed

Lines changed: 24 additions & 0 deletions

File tree

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Evgeny Safronov <[email protected]>
3232
Fabien Pichot <[email protected]>
3333
Federico Ficarelli <[email protected]>
3434
Felix Homann <[email protected]>
35+
Felmon Fekadu <[email protected]>
3536
Gergely Meszaros <[email protected]>
3637
Gergő Szitár <[email protected]>
3738
Google Inc.

CONTRIBUTORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ Fabien Pichot <[email protected]>
5252
Fanbo Meng <[email protected]>
5353
Federico Ficarelli <[email protected]>
5454
Felix Homann <[email protected]>
55+
Felmon Fekadu <[email protected]>
5556
Geoffrey Martin-Noble <[email protected]> <[email protected]>
5657
Gergely Meszaros <[email protected]>
5758
Gergő Szitár <[email protected]>

docs/user_guide.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -252,6 +252,28 @@ iterations is at least one, not more than 1e9, until CPU time is greater than
252252
the minimum time, or the wallclock time is 5x minimum time. The minimum time is
253253
set per benchmark by calling `MinTime` on the registered benchmark object.
254254
255+
The minimum time can also be set for all benchmarks with the
256+
`--benchmark_min_time=<value>` command-line option. This flag supports two
257+
forms:
258+
259+
* `--benchmark_min_time=<float>s` sets the minimum running time for each
260+
benchmark repetition in seconds.
261+
* `--benchmark_min_time=<integer>x` runs each benchmark repetition for an
262+
explicit number of iterations instead of using the dynamic time-based
263+
iteration selection. This applies to benchmarks that do not already specify
264+
an explicit iteration count in code.
265+
266+
For compatibility, bare numeric values such as `--benchmark_min_time=0.5` are
267+
also interpreted as seconds, but the explicit `s` suffix is preferred for
268+
clarity.
269+
270+
For example:
271+
272+
```bash
273+
$ ./run_benchmarks.x --benchmark_min_time=0.5s
274+
$ ./run_benchmarks.x --benchmark_min_time=100x
275+
```
276+
255277
Furthermore warming up a benchmark might be necessary in order to get
256278
stable results because of e.g caching effects of the code under benchmark.
257279
Warming up means running the benchmark a given amount of time, before

0 commit comments

Comments
 (0)