[libcxx-commits] [libcxx] 7637618 - [libc++] Reduce the number of runs on the stop_token benchmarks (#179914)

via libcxx-commits libcxx-commits at lists.llvm.org
Sat Feb 7 02:17:11 PST 2026


Author: Nikolas Klauser
Date: 2026-02-07T11:17:05+01:00
New Revision: 763761888f644615cde7db1d896e46daf2b85db3

URL: https://github.com/llvm/llvm-project/commit/763761888f644615cde7db1d896e46daf2b85db3
DIFF: https://github.com/llvm/llvm-project/commit/763761888f644615cde7db1d896e46daf2b85db3.diff

LOG: [libc++] Reduce the number of runs on the stop_token benchmarks (#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 #179697

Added: 
    

Modified: 
    libcxx/test/benchmarks/stop_token.bench.cpp

Removed: 
    


################################################################################
diff  --git a/libcxx/test/benchmarks/stop_token.bench.cpp b/libcxx/test/benchmarks/stop_token.bench.cpp
index a627f80697dd5..a386c30c6c15c 100644
--- a/libcxx/test/benchmarks/stop_token.bench.cpp
+++ b/libcxx/test/benchmarks/stop_token.bench.cpp
@@ -42,7 +42,7 @@ void BM_stop_token_single_thread_polling_stop_requested(benchmark::State& state)
   }
 }
 
-BENCHMARK(BM_stop_token_single_thread_polling_stop_requested)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
+BENCHMARK(BM_stop_token_single_thread_polling_stop_requested)->Arg(1024)->Arg(131072)->Arg(16777216);
 
 // We have multiple threads polling for stop_requested of the same stop_token.
 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)
   ss.request_stop();
 }
 
-BENCHMARK(BM_stop_token_multi_thread_polling_stop_requested)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
+BENCHMARK(BM_stop_token_multi_thread_polling_stop_requested)->Arg(1024)->Arg(131072)->Arg(16777216);
 
 // We have a single thread created by std::jthread consuming the stop_token:
 // registering/deregistering callbacks, one at a time.
@@ -117,7 +117,7 @@ void BM_stop_token_single_thread_reg_unreg_callback(benchmark::State& state) {
     }
   }
 }
-BENCHMARK(BM_stop_token_single_thread_reg_unreg_callback)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
+BENCHMARK(BM_stop_token_single_thread_reg_unreg_callback)->Arg(1024)->Arg(131072)->Arg(16777216);
 
 // At startup, it creates a single stop_source which it will then pass an associated stop_token to every
 // request.
@@ -182,6 +182,6 @@ void BM_stop_token_async_reg_unreg_callback(benchmark::State& state) {
 
   ss.request_stop();
 }
-BENCHMARK(BM_stop_token_async_reg_unreg_callback)->RangeMultiplier(2)->Range(1 << 10, 1 << 24);
+BENCHMARK(BM_stop_token_async_reg_unreg_callback)->Arg(1024)->Arg(131072)->Arg(16777216);
 
 BENCHMARK_MAIN();


        


More information about the libcxx-commits mailing list