MCPcopy Create free account
hub / github.com/apache/arrow / memory_latency

Function memory_latency

cpp/src/arrow/util/machine_benchmark.cc:56–68  ·  view source on GitHub ↗

Cache / main memory latency, depending on the working set size

Source from the content-addressed store, hash-verified

54
55// Cache / main memory latency, depending on the working set size
56static void memory_latency(benchmark::State& state) {
57 const auto niters = static_cast<int32_t>(state.range(0));
58 const std::vector<int32_t> path = RandomPath(niters / 4);
59
60 int32_t total = 0;
61 int32_t index = 0;
62 for (auto _ : state) {
63 total += index;
64 index = path[index];
65 }
66 benchmark::DoNotOptimize(total);
67 state.SetItemsProcessed(state.iterations());
68}
69
70BENCHMARK(memory_latency)->Repetitions(1)->RangeMultiplier(2)->Range(2 << 10, 2 << 24);
71

Callers

nothing calls this directly

Calls 1

RandomPathFunction · 0.85

Tested by

no test coverage detected