Skip to content
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

explains how folly benchmark decides how many iterations to run and how to tune it #2348

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all 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
7 changes: 5 additions & 2 deletions folly/docs/Benchmark.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,11 @@ about it. Sometimes the function itself would want to do that
iteration---for example how about inserting `n` elements instead of
100 elements? To do the iteration internally, use `BENCHMARK` with two
parameters. The second parameter is the number of iterations and is
passed by the framework down to the function. The type of the count is
implicitly `unsigned`. Consider a slightly reworked example:
passed by the framework down to the function (folly benchmark runs as many as
iterations until the time spent exceeds a threshold defined in the code.
To increase iterations, especially for high-latency methods, adjust the `bm_min_usec` flag
and `bm_max_secs` flag to allow higher time budget. Or adjust `bm_min_iters` to increase the minium iterations.).
The type of the count is implicitly `unsigned`. Consider a slightly reworked example:

``` Cpp
#include <folly/Benchmark.h>
Expand Down