folly
folly copied to clipboard
Support invoking a benchmark by name.
Say I have:
BENCHMARK(Q1) {
// blah
}
BENCHMARK(Q2) {
// blah
}
BENCHMARK(Q3) {
// blah
}
int main() {
// In my main, I'd like pass arguments to control which benchmark to run
for (auto name: FLAG_benchmark_to_run) {
FOLLY_INVOKE_BENCHMARK_BY_NAME(name);
}
}
For example, how do I support:
# This skips Q2
./my_benchmark --benchmark_to_run=Q1,Q3
Is there anything like FOLLY_INVOKE_BENCHMARK_BY_NAME
available?
Hi @shiyu-bytedance, folly has a --bm_regex
flag built-in by default that lets you filter the benchmarks you want to run in a given a binary. More details here:
https://github.com/facebook/folly/blob/main/folly/Benchmark.cpp#L65