Skip to content

Commit 667e991

Browse files
committed
Reduce perf-lotsofthreads iterations 10x in Debug
The benchmark's purpose is to stress the cross-thread free path under contention, which is already observable at much lower iteration counts. Debug builds carry full instrumentation and run ~10x slower per iteration, so 200k iterations across 8 threads makes this single test dominate Debug ctest wall-time without producing any additional contention coverage relative to a smaller count. Divide iterations by 10 when NDEBUG is not defined. Release builds keep the original counts (200000 / 50000 depending on platform and sanitizer) so the benchmark's signal is unchanged where it matters. Local measurement on Debug: perf-lotsofthreads-fast: ~136s -> 13.6s perf-lotsofthreads-check: ~500s -> 49.7s The test is on the concurrency-stress exclusion list and so is deliberately not affected by the --smoke knob; reducing iterations in Debug here is the right lever.
1 parent c615edb commit 667e991

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

src/test/perf/lotsofthreads/lotsofthread.cc

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,14 @@ int main()
101101
#else
102102
size_t iterations = 200000;
103103
#endif
104+
#ifndef NDEBUG
105+
// Debug builds run with full instrumentation enabled and are
106+
// ~10x slower per iteration. The cross-thread batch behaviour
107+
// this benchmark stresses is observable at much lower counts;
108+
// reduce iterations so this test does not dominate Debug ctest
109+
// wall-time. Release builds are unaffected.
110+
iterations /= 10;
111+
#endif
104112

105113
int threadcount = 8;
106114
vector<thread> threads;

0 commit comments

Comments
 (0)