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

Function CreateFlatMap

valdi/test/benchmark/map_benchmark.cpp:23–34  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

21BENCHMARK(CreateUnorderedMap)->DenseRange(8, 128, 8);
22
23static void CreateFlatMap(benchmark::State& state) {
24 StringCache stringCache;
25 auto cachedStrings = makeRandomInternedStrings(stringCache, state.range(0), 10);
26
27 for (auto _ : state) {
28 Valdi::FlatMap<StringBox, bool> map;
29
30 for (const auto& str : cachedStrings) {
31 map[str] = true;
32 }
33 }
34}
35BENCHMARK(CreateFlatMap)->DenseRange(8, 128, 8);
36
37static void CreateUnorderedMapWithReserve(benchmark::State& state) {

Callers

nothing calls this directly

Calls 1

Tested by

no test coverage detected