diff options
author | Mikhail Borisov <borisov.mikhail@gmail.com> | 2022-02-10 16:45:40 +0300 |
---|---|---|
committer | Daniil Cherednik <dcherednik@yandex-team.ru> | 2022-02-10 16:45:40 +0300 |
commit | 5d50718e66d9c037dc587a0211110b7d25a66185 (patch) | |
tree | e98df59de24d2ef7c77baed9f41e4875a2fef972 /util/string/benchmark | |
parent | a6a92afe03e02795227d2641b49819b687f088f8 (diff) | |
download | ydb-5d50718e66d9c037dc587a0211110b7d25a66185.tar.gz |
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 2 of 2.
Diffstat (limited to 'util/string/benchmark')
-rw-r--r-- | util/string/benchmark/ascii/main.cpp | 70 | ||||
-rw-r--r-- | util/string/benchmark/float_to_string/metrics/main.py | 2 | ||||
-rw-r--r-- | util/string/benchmark/join/metrics/main.py | 2 | ||||
-rw-r--r-- | util/string/benchmark/subst_global/metrics/main.py | 2 |
4 files changed, 38 insertions, 38 deletions
diff --git a/util/string/benchmark/ascii/main.cpp b/util/string/benchmark/ascii/main.cpp index 49ad13228d..673047025d 100644 --- a/util/string/benchmark/ascii/main.cpp +++ b/util/string/benchmark/ascii/main.cpp @@ -17,20 +17,20 @@ namespace { return Get((ui8)x) ? x + ('a' - 'A') : x; } }; - - struct TToLowerLookup { - char Table[256]; - - TToLowerLookup() { - for (size_t i : xrange(256)) { - Table[i] = AsciiToLower(i); - } - } - - char ToLower(char x) const noexcept { - return Table[(ui8)x]; - } - }; + + struct TToLowerLookup { + char Table[256]; + + TToLowerLookup() { + for (size_t i : xrange(256)) { + Table[i] = AsciiToLower(i); + } + } + + char ToLower(char x) const noexcept { + return Table[(ui8)x]; + } + }; } static inline char FastAsciiToLower(char c) { @@ -91,27 +91,27 @@ Y_CPU_BENCHMARK(BitMapAsciiToLower, iface) { } } -Y_CPU_BENCHMARK(LookupAsciiToLower, iface) { - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - - for (int j = 0; j < 256; ++j) { - Y_DO_NOT_OPTIMIZE_AWAY(Singleton<TToLowerLookup>()->ToLower(j)); - } - } -} - -Y_CPU_BENCHMARK(LookupAsciiToLowerNoSingleton, iface) { - TToLowerLookup lookup; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - - for (int j = 0; j < 256; ++j) { - Y_DO_NOT_OPTIMIZE_AWAY(lookup.ToLower(j)); - } - } -} - +Y_CPU_BENCHMARK(LookupAsciiToLower, iface) { + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); + + for (int j = 0; j < 256; ++j) { + Y_DO_NOT_OPTIMIZE_AWAY(Singleton<TToLowerLookup>()->ToLower(j)); + } + } +} + +Y_CPU_BENCHMARK(LookupAsciiToLowerNoSingleton, iface) { + TToLowerLookup lookup; + for (const auto i : xrange(iface.Iterations())) { + Y_UNUSED(i); + + for (int j = 0; j < 256; ++j) { + Y_DO_NOT_OPTIMIZE_AWAY(lookup.ToLower(j)); + } + } +} + Y_CPU_BENCHMARK(tolower, iface) { for (const auto i : xrange(iface.Iterations())) { Y_UNUSED(i); diff --git a/util/string/benchmark/float_to_string/metrics/main.py b/util/string/benchmark/float_to_string/metrics/main.py index ec98b468e0..e9d4b7ac1d 100644 --- a/util/string/benchmark/float_to_string/metrics/main.py +++ b/util/string/benchmark/float_to_string/metrics/main.py @@ -2,4 +2,4 @@ import yatest.common as yc def test_export_metrics(metrics): - metrics.set_benchmark(yc.execute_benchmark('util/string/benchmark/float_to_string/float_to_string', threads=8)) + metrics.set_benchmark(yc.execute_benchmark('util/string/benchmark/float_to_string/float_to_string', threads=8)) diff --git a/util/string/benchmark/join/metrics/main.py b/util/string/benchmark/join/metrics/main.py index 876985d719..1ed5014808 100644 --- a/util/string/benchmark/join/metrics/main.py +++ b/util/string/benchmark/join/metrics/main.py @@ -2,4 +2,4 @@ import yatest.common as yc def test_export_metrics(metrics): - metrics.set_benchmark(yc.execute_benchmark('util/string/benchmark/join/join', threads=8)) + metrics.set_benchmark(yc.execute_benchmark('util/string/benchmark/join/join', threads=8)) diff --git a/util/string/benchmark/subst_global/metrics/main.py b/util/string/benchmark/subst_global/metrics/main.py index dcfc0e1307..62f2f3d76d 100644 --- a/util/string/benchmark/subst_global/metrics/main.py +++ b/util/string/benchmark/subst_global/metrics/main.py @@ -2,4 +2,4 @@ import yatest.common as yc def test_export_metrics(metrics): - metrics.set_benchmark(yc.execute_benchmark('util/string/benchmark/subst_global/subst_global', threads=8)) + metrics.set_benchmark(yc.execute_benchmark('util/string/benchmark/subst_global/subst_global', threads=8)) |