| 75 | } |
| 76 | |
| 77 | static void WriteRecordBatch(benchmark::State& state) { // NOLINT non-const reference |
| 78 | // 1MB |
| 79 | constexpr int64_t kTotalSize = 1 << 20; |
| 80 | auto options = ipc::IpcWriteOptions::Defaults(); |
| 81 | |
| 82 | std::shared_ptr<ResizableBuffer> buffer = *AllocateResizableBuffer(1024); |
| 83 | auto record_batch = MakeRecordBatch(kTotalSize, state.range(0)); |
| 84 | |
| 85 | while (state.KeepRunning()) { |
| 86 | io::BufferOutputStream stream(buffer); |
| 87 | int32_t metadata_length; |
| 88 | int64_t body_length; |
| 89 | ABORT_NOT_OK(ipc::WriteRecordBatch(*record_batch, 0, &stream, &metadata_length, |
| 90 | &body_length, options)); |
| 91 | } |
| 92 | state.SetBytesProcessed(int64_t(state.iterations()) * kTotalSize); |
| 93 | } |
| 94 | |
| 95 | static void ReadRecordBatch(benchmark::State& state) { // NOLINT non-const reference |
| 96 | // 1MB |
no test coverage detected