| 93 | } |
| 94 | |
| 95 | static void ReadRecordBatch(benchmark::State& state) { // NOLINT non-const reference |
| 96 | // 1MB |
| 97 | constexpr int64_t kTotalSize = 1 << 20; |
| 98 | auto options = ipc::IpcWriteOptions::Defaults(); |
| 99 | |
| 100 | std::shared_ptr<ResizableBuffer> buffer = *AllocateResizableBuffer(1024); |
| 101 | auto record_batch = MakeRecordBatch(kTotalSize, state.range(0)); |
| 102 | |
| 103 | io::BufferOutputStream stream(buffer); |
| 104 | |
| 105 | int32_t metadata_length; |
| 106 | int64_t body_length; |
| 107 | ABORT_NOT_OK(ipc::WriteRecordBatch(*record_batch, 0, &stream, &metadata_length, |
| 108 | &body_length, options)); |
| 109 | |
| 110 | ipc::DictionaryMemo empty_memo; |
| 111 | while (state.KeepRunning()) { |
| 112 | io::BufferReader reader(buffer); |
| 113 | ABORT_NOT_OK(ipc::ReadRecordBatch(record_batch->schema(), &empty_memo, |
| 114 | ipc::IpcReadOptions::Defaults(), &reader)); |
| 115 | } |
| 116 | state.SetBytesProcessed(int64_t(state.iterations()) * kTotalSize); |
| 117 | } |
| 118 | |
| 119 | static void ReadStream(benchmark::State& state) { // NOLINT non-const reference |
| 120 | // 1MB |
nothing calls this directly
no test coverage detected