MCPcopy Create free account
hub / github.com/catboost/catboost / RunTest

Function RunTest

library/cpp/testing/benchmark/bench.cpp:238–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

236
237 template <class TMyTimer, class T>
238 static inline TResult RunTest(T&& func, double budget, ITestRunner& test) {
239 THPTimer start;
240
241 start.Passed();
242
243 TSampleIterator sample;
244 TSamples samples;
245 ui64 iters = 0;
246
247 //warm up
248 func(1);
249
250 while (start.Passed() < budget) {
251 if (start.Passed() < ((budget * samples.size()) / 2000000.0)) {
252 ThreadYield();
253 } else {
254 const size_t n = sample.Next();
255
256 iters += (ui64)n;
257 samples.emplace_back(n, Measure<TMyTimer>(func, n));
258 }
259 }
260
261 auto filtered = RemoveOutliers(samples, 0.9);
262
263 return {test.Name(), filtered.size(), iters, CalcModel(filtered).A, Nothing(), start.Passed(), test.SequentialId};
264 }
265
266 using TTests = TIntrusiveListWithAutoDelete<ITestRunner, TDestructor>;
267

Callers

nothing calls this directly

Calls 10

funcFunction · 0.85
ThreadYieldFunction · 0.85
RemoveOutliersFunction · 0.85
CalcModelFunction · 0.85
NothingFunction · 0.85
PassedMethod · 0.45
sizeMethod · 0.45
NextMethod · 0.45
emplace_backMethod · 0.45
NameMethod · 0.45

Tested by

no test coverage detected