Skip to content

Commit

Permalink
explains how folly benchmark decides how many iterations to run and h…
Browse files Browse the repository at this point in the history
…ow to tune it (#2348)

Summary:

I spent some time to figure this out and it should be beneficial to mention that in the doc

Differential Revision: D66708725
  • Loading branch information
Zhijian Jiang authored and facebook-github-bot committed Dec 6, 2024
1 parent bd13203 commit d9d7cf9
Showing 1 changed file with 5 additions and 2 deletions.
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

0 comments on commit d9d7cf9

Please sign in to comment.