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

Function ParallelMemoryCopy

cpp/src/arrow/io/memory_benchmark.cc:293–309  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291#endif // ARROW_WITH_BENCHMARKS_REFERENCE
292
293static void ParallelMemoryCopy(benchmark::State& state) { // NOLINT non-const reference
294 const int64_t n_threads = state.range(0);
295 const int64_t buffer_size = kMemoryPerCore;
296
297 auto src = *AllocateBuffer(buffer_size);
298 std::shared_ptr<Buffer> dst = *AllocateBuffer(buffer_size);
299
300 random_bytes(buffer_size, 0, src->mutable_data());
301
302 while (state.KeepRunning()) {
303 io::FixedSizeBufferWriter writer(dst);
304 writer.set_memcopy_threads(static_cast<int>(n_threads));
305 ABORT_NOT_OK(writer.Write(src->data(), src->size()));
306 }
307
308 state.SetBytesProcessed(int64_t(state.iterations()) * buffer_size);
309}
310
311BENCHMARK(ParallelMemoryCopy)
312 ->RangeMultiplier(2)

Callers

nothing calls this directly

Calls 7

AllocateBufferFunction · 0.50
random_bytesFunction · 0.50
mutable_dataMethod · 0.45
set_memcopy_threadsMethod · 0.45
WriteMethod · 0.45
dataMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected