| 78 | BENCHMARK(CreateMapWithRegularStrings)->Range(8, 512); |
| 79 | |
| 80 | static void CreateMapWithInternedStrings(benchmark::State& state) { |
| 81 | auto strings = makeRandomStrings(state.range(0)); |
| 82 | auto& stringCache = StringCache::getGlobal(); |
| 83 | |
| 84 | auto cachedStrings = internStrings(stringCache, strings); |
| 85 | |
| 86 | for (auto _ : state) { |
| 87 | FlatMap<StringBox, bool> map; |
| 88 | map.reserve(cachedStrings.size()); |
| 89 | |
| 90 | for (const auto& str : cachedStrings) { |
| 91 | map[str] = true; |
| 92 | } |
| 93 | } |
| 94 | } |
| 95 | BENCHMARK(CreateMapWithInternedStrings)->Range(8, 512); |
| 96 | |
| 97 | static void QueryMapWithRegularStrings(benchmark::State& state) { |
nothing calls this directly
no test coverage detected