MCPcopy Create free account
hub / github.com/apple/foundationdb / bench_iterate

Function bench_iterate

flowbench/BenchIterate.cpp:47–59  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

45// Benchmarks iteration over a list of mutations
46template <class ListImpl>
47static void bench_iterate(benchmark::State& state) {
48 size_t items = state.range(0);
49 size_t size = state.range(1);
50 auto kv = getKV(size, size);
51 ListImpl mutations;
52 populate(mutations, items, size, kv.key, kv.value);
53 while (state.KeepRunning()) {
54 for (const auto& mutation : mutations) {
55 benchmark::DoNotOptimize(mutation);
56 }
57 }
58 state.SetItemsProcessed(items * static_cast<long>(state.iterations()));
59}
60
61BENCHMARK_TEMPLATE(bench_iterate, Standalone<VectorRef<MutationRef>>)
62 ->Ranges({ { 1, 1 << 20 }, { 1, 1 << 9 } })

Callers

nothing calls this directly

Calls 3

getKVFunction · 0.85
populateFunction · 0.70
rangeMethod · 0.45

Tested by

no test coverage detected