MCPcopy Create free account
hub / github.com/cameron314/concurrentqueue / rampUpToMeasurableNumberOfMaxOps

Function rampUpToMeasurableNumberOfMaxOps

benchmarks/benchmarks.cpp:292–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290
291template<typename TFunc>
292counter_t rampUpToMeasurableNumberOfMaxOps(TFunc const& func, counter_t startOps = 256)
293{
294 counter_t ops = startOps;
295 double time;
296 do {
297 time = func(ops);
298 ops *= 2;
299 } while (time < (precise ? 30 : 10));
300#ifdef NDEBUG
301 return ops / 2;
302#else
303 return ops / 4;
304#endif
305}
306
307counter_t adjustForThreads(counter_t suggestedOps, int nthreads)
308{

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected