| 45 | // Benchmarks iteration over a list of mutations |
| 46 | template <class ListImpl> |
| 47 | static 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 | |
| 61 | BENCHMARK_TEMPLATE(bench_iterate, Standalone<VectorRef<MutationRef>>) |
| 62 | ->Ranges({ { 1, 1 << 20 }, { 1, 1 << 9 } }) |