| 291 | #endif // ARROW_WITH_BENCHMARKS_REFERENCE |
| 292 | |
| 293 | static 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 | |
| 311 | BENCHMARK(ParallelMemoryCopy) |
| 312 | ->RangeMultiplier(2) |
nothing calls this directly
no test coverage detected