diff options
author | danlark <danlark@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:46:08 +0300 |
commit | 3426a9bc7f169ae9da54cef557ad2a33f6e8eee0 (patch) | |
tree | 26154e1e9990f1bb4525d3e3fb5b6dac2c2c1da2 /library/cpp/testing/benchmark/bench.cpp | |
parent | cb68f224c46a8ee52ac3fdd2a32534b8bb8dc134 (diff) | |
download | ydb-3426a9bc7f169ae9da54cef557ad2a33f6e8eee0.tar.gz |
Restoring authorship annotation for <danlark@yandex-team.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/testing/benchmark/bench.cpp')
-rw-r--r-- | library/cpp/testing/benchmark/bench.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/testing/benchmark/bench.cpp b/library/cpp/testing/benchmark/bench.cpp index 08d8708005..9c6e6ae96d 100644 --- a/library/cpp/testing/benchmark/bench.cpp +++ b/library/cpp/testing/benchmark/bench.cpp @@ -189,7 +189,7 @@ namespace { } inline TSamples RemoveOutliers(const TSamples& s, double fraction) { - if (s.size() < 20) { + if (s.size() < 20) { return s; } @@ -205,7 +205,7 @@ namespace { using TSampleWithError = std::pair<const TSample*, double>; TVector<TSampleWithError> v; - v.reserve(s.size()); + v.reserve(s.size()); for (const auto& p : s) { v.emplace_back(&p, errfunc(p)); @@ -223,9 +223,9 @@ namespace { TSamples ret; - ret.reserve(v.size()); + ret.reserve(v.size()); - for (const auto i : xrange<size_t>(0, fraction * v.size())) { + for (const auto i : xrange<size_t>(0, fraction * v.size())) { ret.push_back(*v[i].first); } @@ -246,7 +246,7 @@ namespace { func(1); while (start.Passed() < budget) { - if (start.Passed() < ((budget * samples.size()) / 2000000.0)) { + if (start.Passed() < ((budget * samples.size()) / 2000000.0)) { ThreadYield(); } else { const size_t n = sample.Next(); @@ -258,7 +258,7 @@ namespace { auto filtered = RemoveOutliers(samples, 0.9); - return {test.Name(), filtered.size(), iters, CalcModel(filtered).A, Nothing(), start.Passed(), test.SequentialId}; + return {test.Name(), filtered.size(), iters, CalcModel(filtered).A, Nothing(), start.Passed(), test.SequentialId}; } using TTests = TIntrusiveListWithAutoDelete<ITestRunner, TDestructor>; @@ -523,7 +523,7 @@ namespace { const TOptsParseResult parseResult{&opts, argc, argv}; for (const auto& regexp : parseResult.GetFreeArgs()) { - Filters.push_back(MakeHolder<RE2>(regexp.data(), RE2::Quiet)); + Filters.push_back(MakeHolder<RE2>(regexp.data(), RE2::Quiet)); Y_ENSURE(Filters.back()->ok(), "incorrect RE2 expression '" << regexp << "'"); } } @@ -534,7 +534,7 @@ namespace { } for (auto&& re : Filters) { - if (RE2::FullMatchN({name.data(), name.size()}, *re, nullptr, 0)) { + if (RE2::FullMatchN({name.data(), name.size()}, *re, nullptr, 0)) { return true; } } @@ -577,10 +577,10 @@ int NBench::Main(int argc, char** argv) { double timeBudget = opts.TimeBudget; if (timeBudget < 0) { - timeBudget = 5.0 * tests.size(); + timeBudget = 5.0 * tests.size(); } - const TOptions testOpts = {timeBudget / tests.size()}; + const TOptions testOpts = {timeBudget / tests.size()}; const auto reporter = MakeOrderedReporter(opts.OutFormat); std::function<void(ITestRunner**)> func = [&](ITestRunner** it) { |