| 85 | BENCHMARK(QueryUnorderedMap)->DenseRange(8, 128, 8); |
| 86 | |
| 87 | static void QueryFlatMap(benchmark::State& state) { |
| 88 | StringCache stringCache; |
| 89 | auto cachedStrings = makeRandomInternedStrings(stringCache, state.range(0), 10); |
| 90 | |
| 91 | Valdi::FlatMap<StringBox, bool> map; |
| 92 | |
| 93 | for (const auto& str : cachedStrings) { |
| 94 | map[str] = true; |
| 95 | } |
| 96 | |
| 97 | for (auto _ : state) { |
| 98 | for (const auto& str : cachedStrings) { |
| 99 | const auto& it = map.find(str); |
| 100 | |
| 101 | benchmark::DoNotOptimize(it != map.end()); |
| 102 | } |
| 103 | } |
| 104 | } |
| 105 | BENCHMARK(QueryFlatMap)->DenseRange(8, 128, 8); |
| 106 | |
| 107 | static void IterateUnorderedMap(benchmark::State& state) { |
nothing calls this directly
no test coverage detected