| 95 | BENCHMARK(CreateMapWithInternedStrings)->Range(8, 512); |
| 96 | |
| 97 | static void QueryMapWithRegularStrings(benchmark::State& state) { |
| 98 | auto strings = makeRandomStrings(state.range(0)); |
| 99 | FlatMap<std::string, bool> map; |
| 100 | |
| 101 | for (const auto& str : strings) { |
| 102 | map[str] = true; |
| 103 | } |
| 104 | |
| 105 | for (auto _ : state) { |
| 106 | for (const auto& str : strings) { |
| 107 | const auto& it = map.find(str); |
| 108 | |
| 109 | benchmark::DoNotOptimize(it != map.end()); |
| 110 | } |
| 111 | } |
| 112 | } |
| 113 | BENCHMARK(QueryMapWithRegularStrings)->Range(8, 512); |
| 114 | |
| 115 | static void QueryMapWithInternedStrings(benchmark::State& state) { |
nothing calls this directly
no test coverage detected