diff options
| author | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
|---|---|---|
| committer | monster <[email protected]> | 2022-07-07 14:41:37 +0300 |
| commit | 06e5c21a835c0e923506c4ff27929f34e00761c2 (patch) | |
| tree | 75efcbc6854ef9bd476eb8bf00cc5c900da436a2 /util/string/benchmark/strip/main.cpp | |
| parent | 03f024c4412e3aa613bb543cf1660176320ba8f4 (diff) | |
fix ya.make
Diffstat (limited to 'util/string/benchmark/strip/main.cpp')
| -rw-r--r-- | util/string/benchmark/strip/main.cpp | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/util/string/benchmark/strip/main.cpp b/util/string/benchmark/strip/main.cpp deleted file mode 100644 index 35a266e4f4d..00000000000 --- a/util/string/benchmark/strip/main.cpp +++ /dev/null @@ -1,65 +0,0 @@ -#include <library/cpp/testing/benchmark/bench.h> - -#include <util/string/strip.h> -#include <util/generic/xrange.h> - -static const TString SHORT_STRING = " foo "; -static const TString LONG_STRING = TString(200, ' ') + TString(200, 'f') + TString(200, ' '); - -Y_CPU_BENCHMARK(StripInPlaceShortNoChange, iface) { - TString s = "foo"; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - StripInPlace(s); - Y_DO_NOT_OPTIMIZE_AWAY(s); - } -} - -Y_CPU_BENCHMARK(StripInPlaceLongNoChange, iface) { - TString s = TString{200, 'f'}; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - StripInPlace(s); - Y_DO_NOT_OPTIMIZE_AWAY(s); - } -} - -Y_CPU_BENCHMARK(StripInPlaceShort, iface) { - TString s; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - s.assign(SHORT_STRING.begin(), SHORT_STRING.end()); - StripInPlace(s); - Y_DO_NOT_OPTIMIZE_AWAY(s); - } -} - -Y_CPU_BENCHMARK(StripInPlaceLong, iface) { - TString s; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - s.assign(LONG_STRING.begin(), LONG_STRING.end()); - StripInPlace(s); - Y_DO_NOT_OPTIMIZE_AWAY(s); - } -} - -Y_CPU_BENCHMARK(StripInPlaceShortMut, iface) { - TString s = SHORT_STRING; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - s.append(' '); - StripInPlace(s); - Y_DO_NOT_OPTIMIZE_AWAY(s); - } -} - -Y_CPU_BENCHMARK(StripInPlaceLongMut, iface) { - TString s = LONG_STRING; - for (const auto i : xrange(iface.Iterations())) { - Y_UNUSED(i); - s.append(100, ' '); - StripInPlace(s); - Y_DO_NOT_OPTIMIZE_AWAY(s); - } -} |
