diff options
| author | vskipin <[email protected]> | 2022-02-10 16:46:00 +0300 | 
|---|---|---|
| committer | Daniil Cherednik <[email protected]> | 2022-02-10 16:46:00 +0300 | 
| commit | 4e4b78bd7b67e2533da4dbb9696374a6d6068e32 (patch) | |
| tree | a7a5543d815c451256ece74081d960b4e1d70ec2 /library/cpp/threading/future/perf/main.cpp | |
| parent | 5b00ed04a5137a452fa6d3423cb0c9b54ac27408 (diff) | |
Restoring authorship annotation for <[email protected]>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/future/perf/main.cpp')
| -rw-r--r-- | library/cpp/threading/future/perf/main.cpp | 70 | 
1 files changed, 35 insertions, 35 deletions
diff --git a/library/cpp/threading/future/perf/main.cpp b/library/cpp/threading/future/perf/main.cpp index 5a0690af473..71e9e293de1 100644 --- a/library/cpp/threading/future/perf/main.cpp +++ b/library/cpp/threading/future/perf/main.cpp @@ -1,50 +1,50 @@  #include <library/cpp/testing/benchmark/bench.h>  #include <library/cpp/threading/future/future.h> - +   #include <util/generic/string.h> -#include <util/generic/xrange.h> - -using namespace NThreading; - -template <typename T> +#include <util/generic/xrange.h>  +  +using namespace NThreading;  +  +template <typename T>   void TestAllocPromise(const NBench::NCpu::TParams& iface) {      for (const auto it : xrange(iface.Iterations())) { -        Y_UNUSED(it); -        Y_DO_NOT_OPTIMIZE_AWAY(NewPromise<T>()); -    } -} - -template <typename T> +        Y_UNUSED(it);  +        Y_DO_NOT_OPTIMIZE_AWAY(NewPromise<T>());  +    }  +}  +  +template <typename T>   TPromise<T> SetPromise(T value) { -    auto promise = NewPromise<T>(); -    promise.SetValue(value); -    return promise; -} - -template <typename T> +    auto promise = NewPromise<T>();  +    promise.SetValue(value);  +    return promise;  +}  +  +template <typename T>   void TestSetPromise(const NBench::NCpu::TParams& iface, T value) {      for (const auto it : xrange(iface.Iterations())) { -        Y_UNUSED(it); -        Y_DO_NOT_OPTIMIZE_AWAY(SetPromise(value)); -    } -} - +        Y_UNUSED(it);  +        Y_DO_NOT_OPTIMIZE_AWAY(SetPromise(value));  +    }  +}  +   Y_CPU_BENCHMARK(AllocPromiseVoid, iface) { -    TestAllocPromise<void>(iface); -} - +    TestAllocPromise<void>(iface);  +}  +   Y_CPU_BENCHMARK(AllocPromiseUI64, iface) { -    TestAllocPromise<ui64>(iface); -} - +    TestAllocPromise<ui64>(iface);  +}  +   Y_CPU_BENCHMARK(AllocPromiseStroka, iface) {      TestAllocPromise<TString>(iface); -} - +}  +   Y_CPU_BENCHMARK(SetPromiseUI64, iface) { -    TestSetPromise<ui64>(iface, 1234567890ull); -} - +    TestSetPromise<ui64>(iface, 1234567890ull);  +}  +   Y_CPU_BENCHMARK(SetPromiseStroka, iface) {      TestSetPromise<TString>(iface, "test test test"); -} +}   | 
