Defines a benchmark that passes a parameter to another one. This is common for benchmarks that need a "problem size" in addition to "number of iterations". Consider:
Declared in <folly/Benchmark.h>
#define BENCHMARK_PARAM(name, param)
void pushBack(uint32_t n, size_t initialSize) { vector<int> v; BENCHMARK_SUSPEND { v.resize(initialSize); } for (uint32_t i = 0; i < n; ++i) { v.push_back(i); } } BENCHMARK_PARAM(pushBack, 0) BENCHMARK_PARAM(pushBack, 1000) BENCHMARK_PARAM(pushBack, 1000000)
The benchmark above estimates the speed of push_back at different initial sizes of the vector. The framework will pass 0, 1000, and 1000000 for initialSize, and the iteration count for n.
| Name | Description |
|---|---|
| name | The benchmarked function's identifier. |
| param | The parameter value passed to the benchmarked function. |