How long does it take to compare regular std::strings Used as base
| 35 | // How long does it take to compare regular std::strings |
| 36 | // Used as base |
| 37 | static void RegularStringComparison(benchmark::State& state) { |
| 38 | auto strings = makeRandomStrings(state.range(0)); |
| 39 | |
| 40 | for (auto _ : state) { |
| 41 | for (const auto& str : strings) { |
| 42 | for (const auto& other : strings) { |
| 43 | benchmark::DoNotOptimize(str == other); |
| 44 | } |
| 45 | } |
| 46 | } |
| 47 | } |
| 48 | BENCHMARK(RegularStringComparison)->Range(8, 512); |
| 49 | |
| 50 | // How long does it take to compare StringBox objects |
nothing calls this directly
no test coverage detected