diff options
author | Anton Samokhvalov <pg83@yandex.ru> | 2022-02-10 16:45:15 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:15 +0300 |
commit | 72cb13b4aff9bc9cf22e49251bc8fd143f82538f (patch) | |
tree | da2c34829458c7d4e74bdfbdf85dff449e9e7fb8 /library/cpp/threading/future/perf | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'library/cpp/threading/future/perf')
-rw-r--r-- | library/cpp/threading/future/perf/main.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/library/cpp/threading/future/perf/main.cpp b/library/cpp/threading/future/perf/main.cpp index 5a0690af47..c7da5a51f3 100644 --- a/library/cpp/threading/future/perf/main.cpp +++ b/library/cpp/threading/future/perf/main.cpp @@ -7,44 +7,44 @@ using namespace NThreading; template <typename T> -void TestAllocPromise(const NBench::NCpu::TParams& iface) { - for (const auto it : xrange(iface.Iterations())) { +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> -TPromise<T> SetPromise(T value) { +TPromise<T> SetPromise(T value) { 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())) { +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_CPU_BENCHMARK(AllocPromiseVoid, iface) { +Y_CPU_BENCHMARK(AllocPromiseVoid, iface) { TestAllocPromise<void>(iface); } -Y_CPU_BENCHMARK(AllocPromiseUI64, iface) { +Y_CPU_BENCHMARK(AllocPromiseUI64, iface) { TestAllocPromise<ui64>(iface); } -Y_CPU_BENCHMARK(AllocPromiseStroka, iface) { +Y_CPU_BENCHMARK(AllocPromiseStroka, iface) { TestAllocPromise<TString>(iface); } -Y_CPU_BENCHMARK(SetPromiseUI64, iface) { +Y_CPU_BENCHMARK(SetPromiseUI64, iface) { TestSetPromise<ui64>(iface, 1234567890ull); } -Y_CPU_BENCHMARK(SetPromiseStroka, iface) { +Y_CPU_BENCHMARK(SetPromiseStroka, iface) { TestSetPromise<TString>(iface, "test test test"); } |