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 /util/string/benchmark/cast | |
parent | 778e51ba091dc39e7b7fcab2b9cf4dbedfb6f2b5 (diff) | |
download | ydb-72cb13b4aff9bc9cf22e49251bc8fd143f82538f.tar.gz |
Restoring authorship annotation for Anton Samokhvalov <pg83@yandex.ru>. Commit 1 of 2.
Diffstat (limited to 'util/string/benchmark/cast')
-rw-r--r-- | util/string/benchmark/cast/main.cpp | 104 | ||||
-rw-r--r-- | util/string/benchmark/cast/ya.make | 16 |
2 files changed, 60 insertions, 60 deletions
diff --git a/util/string/benchmark/cast/main.cpp b/util/string/benchmark/cast/main.cpp index f604712ab6..341c8a55d3 100644 --- a/util/string/benchmark/cast/main.cpp +++ b/util/string/benchmark/cast/main.cpp @@ -1,66 +1,66 @@ #include <library/cpp/testing/benchmark/bench.h> - -#include <util/string/cast.h> -#include <util/generic/xrange.h> - + +#include <util/string/cast.h> +#include <util/generic/xrange.h> + char str1[] = "1"; char str12[] = "12"; char str1234[] = "1234"; char str12345678[] = "12345678"; -Y_CPU_BENCHMARK(Parse_1, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); +Y_CPU_BENCHMARK(Parse_1, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(FromString<ui32>(str1, 1)); - } -} - -Y_CPU_BENCHMARK(Parse_12, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +Y_CPU_BENCHMARK(Parse_12, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(FromString<ui32>(str12, 2)); - } -} - -Y_CPU_BENCHMARK(Parse_1234, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +Y_CPU_BENCHMARK(Parse_1234, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(FromString<ui32>(str1234, 4)); - } -} - -Y_CPU_BENCHMARK(Parse_12345678, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +Y_CPU_BENCHMARK(Parse_12345678, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(FromString<ui32>(str12345678, 8)); - } -} - -//atoi -Y_CPU_BENCHMARK(Atoi_1, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +//atoi +Y_CPU_BENCHMARK(Atoi_1, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(atoi(str1)); - } -} - -Y_CPU_BENCHMARK(Atoi_12, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +Y_CPU_BENCHMARK(Atoi_12, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(atoi(str12)); - } -} - -Y_CPU_BENCHMARK(Atoi_1234, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +Y_CPU_BENCHMARK(Atoi_1234, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(atoi(str1234)); - } -} - -Y_CPU_BENCHMARK(Atoi_12345678, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); + } +} + +Y_CPU_BENCHMARK(Atoi_12345678, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); Y_DO_NOT_OPTIMIZE_AWAY(atoi(str12345678)); - } -} + } +} diff --git a/util/string/benchmark/cast/ya.make b/util/string/benchmark/cast/ya.make index f95b9e0fa8..e973ba183a 100644 --- a/util/string/benchmark/cast/ya.make +++ b/util/string/benchmark/cast/ya.make @@ -1,9 +1,9 @@ Y_BENCHMARK() - -OWNER(pg) - -SRCS( - main.cpp -) - -END() + +OWNER(pg) + +SRCS( + main.cpp +) + +END() |