| 94 | } |
| 95 | |
| 96 | void BenchmarkWriteCsv(benchmark::State& state, const WriteOptions& options, |
| 97 | const RecordBatch& batch) { |
| 98 | int64_t total_size = 0; |
| 99 | |
| 100 | for (auto _ : state) { |
| 101 | auto out = io::BufferOutputStream::Create().ValueOrDie(); |
| 102 | ABORT_NOT_OK(WriteCSV(batch, options, out.get())); |
| 103 | auto buffer = out->Finish().ValueOrDie(); |
| 104 | total_size += buffer->size(); |
| 105 | } |
| 106 | |
| 107 | // byte size of the generated csv dataset |
| 108 | state.SetBytesProcessed(total_size); |
| 109 | state.SetItemsProcessed(state.iterations() * batch.num_columns() * batch.num_rows()); |
| 110 | state.counters["null_percent"] = static_cast<double>(state.range(0)); |
| 111 | } |
| 112 | |
| 113 | // Exercises UnQuotedColumnPopulator with integer |
| 114 | void WriteCsvNumeric(benchmark::State& state) { |
no test coverage detected