Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 7637618

Browse files
authored
[libc++] Reduce the number of runs on the stop_token benchmarks (llvm#179914)
Testing a bunch of sizes has relatively little value. This reduces the number of benchmarks so we can run them on a regular basis. Fixes llvm#179697
1 parent 269fda1 commit 7637618

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

libcxx/test/benchmarks/stop_token.bench.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void BM_stop_token_single_thread_polling_stop_requested(benchmark::State& state)
4242
}
4343
}
4444

45-
BENCHMARK(BM_stop_token_single_thread_polling_stop_requested)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
45+
BENCHMARK(BM_stop_token_single_thread_polling_stop_requested)->Arg(1024)->Arg(131072)->Arg(16777216);
4646

4747
// We have multiple threads polling for stop_requested of the same stop_token.
4848
void BM_stop_token_multi_thread_polling_stop_requested(benchmark::State& state) {
@@ -91,7 +91,7 @@ void BM_stop_token_multi_thread_polling_stop_requested(benchmark::State& state)
9191
ss.request_stop();
9292
}
9393

94-
BENCHMARK(BM_stop_token_multi_thread_polling_stop_requested)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
94+
BENCHMARK(BM_stop_token_multi_thread_polling_stop_requested)->Arg(1024)->Arg(131072)->Arg(16777216);
9595

9696
// We have a single thread created by std::jthread consuming the stop_token:
9797
// registering/deregistering callbacks, one at a time.
@@ -117,7 +117,7 @@ void BM_stop_token_single_thread_reg_unreg_callback(benchmark::State& state) {
117117
}
118118
}
119119
}
120-
BENCHMARK(BM_stop_token_single_thread_reg_unreg_callback)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
120+
BENCHMARK(BM_stop_token_single_thread_reg_unreg_callback)->Arg(1024)->Arg(131072)->Arg(16777216);
121121

122122
// At startup, it creates a single stop_source which it will then pass an associated stop_token to every
123123
// request.
@@ -182,6 +182,6 @@ void BM_stop_token_async_reg_unreg_callback(benchmark::State& state) {
182182

183183
ss.request_stop();
184184
}
185-
BENCHMARK(BM_stop_token_async_reg_unreg_callback)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
185+
BENCHMARK(BM_stop_token_async_reg_unreg_callback)->Arg(1024)->Arg(131072)->Arg(16777216);
186186

187187
BENCHMARK_MAIN();

0 commit comments

Comments
 (0)