MCPcopy Create free account
hub / github.com/Snapchat/Valdi / CreateUnorderedMap

Function CreateUnorderedMap

valdi/test/benchmark/map_benchmark.cpp:9–20  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

7using namespace Valdi;
8
9static void CreateUnorderedMap(benchmark::State& state) {
10 StringCache stringCache;
11 auto cachedStrings = makeRandomInternedStrings(stringCache, state.range(0), 10);
12
13 for (auto _ : state) {
14 std::unordered_map<StringBox, bool> map;
15
16 for (const auto& str : cachedStrings) {
17 map[str] = true;
18 }
19 }
20}
21BENCHMARK(CreateUnorderedMap)->DenseRange(8, 128, 8);
22
23static void CreateFlatMap(benchmark::State& state) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected