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

Function lazy_copy

cpp/src/arrow/util/range_benchmark.cc:82–92  ·  view source on GitHub ↗

std::copy with a lazy range as a source

Source from the content-addressed store, hash-verified

80
81// std::copy with a lazy range as a source
82void lazy_copy(benchmark::State& state) {
83 auto source = generate_junk(kSize);
84 std::vector<int> target(kSize);
85 auto lazy_range = internal::MakeLazyRange(
86 [&source](int64_t index) { return source[index]; }, source.size());
87
88 for (auto _ : state) {
89 std::copy(lazy_range.begin(), lazy_range.end(), target.begin());
90 }
91 state.SetItemsProcessed(state.iterations() * kSize);
92}
93
94BENCHMARK(lazy_copy);
95

Callers

nothing calls this directly

Calls 5

generate_junkFunction · 0.85
MakeLazyRangeFunction · 0.85
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected