aboutsummaryrefslogtreecommitdiffstats
path: root/util/string/benchmark
diff options
context:
space:
mode:
authorMikhail Borisov <borisov.mikhail@gmail.com>2022-02-10 16:45:39 +0300
committerDaniil Cherednik <dcherednik@yandex-team.ru>2022-02-10 16:45:39 +0300
commita6a92afe03e02795227d2641b49819b687f088f8 (patch)
treef6984a1d27d5a7ec88a6fdd6e20cd5b7693b6ece /util/string/benchmark
parentc6dc8b8bd530985bc4cce0137e9a5de32f1087cb (diff)
downloadydb-a6a92afe03e02795227d2641b49819b687f088f8.tar.gz
Restoring authorship annotation for Mikhail Borisov <borisov.mikhail@gmail.com>. Commit 1 of 2.
Diffstat (limited to 'util/string/benchmark')
-rw-r--r--util/string/benchmark/ascii/main.cpp70
-rw-r--r--util/string/benchmark/float_to_string/metrics/main.py2
-rw-r--r--util/string/benchmark/join/metrics/main.py2
-rw-r--r--util/string/benchmark/subst_global/metrics/main.py2
4 files changed, 38 insertions, 38 deletions
diff --git a/util/string/benchmark/ascii/main.cpp b/util/string/benchmark/ascii/main.cpp
index 673047025d..49ad13228d 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 e9d4b7ac1d..ec98b468e0 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 1ed5014808..876985d719 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 62f2f3d76d..dcfc0e1307 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))