| 65 | BENCHMARK(CreateFlatMapWithReserve)->DenseRange(8, 128, 8); |
| 66 | |
| 67 | static void QueryUnorderedMap(benchmark::State& state) { |
| 68 | StringCache stringCache; |
| 69 | auto cachedStrings = makeRandomInternedStrings(stringCache, state.range(0), 10); |
| 70 | |
| 71 | std::unordered_map<StringBox, bool> map; |
| 72 | |
| 73 | for (const auto& str : cachedStrings) { |
| 74 | map[str] = true; |
| 75 | } |
| 76 | |
| 77 | for (auto _ : state) { |
| 78 | for (const auto& str : cachedStrings) { |
| 79 | const auto& it = map.find(str); |
| 80 | |
| 81 | benchmark::DoNotOptimize(it != map.end()); |
| 82 | } |
| 83 | } |
| 84 | } |
| 85 | BENCHMARK(QueryUnorderedMap)->DenseRange(8, 128, 8); |
| 86 | |
| 87 | static void QueryFlatMap(benchmark::State& state) { |
nothing calls this directly
no test coverage detected