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

Function BenchmarkWriteCsv

cpp/src/arrow/csv/writer_benchmark.cc:96–111  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

94}
95
96void 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
114void WriteCsvNumeric(benchmark::State& state) {

Callers 5

WriteCsvNumericFunction · 0.85
WriteCsvStringNoQuoteFunction · 0.85
WriteCsvStringWithQuoteFunction · 0.85

Calls 7

WriteCSVFunction · 0.85
ValueOrDieMethod · 0.80
getMethod · 0.45
FinishMethod · 0.45
sizeMethod · 0.45
num_columnsMethod · 0.45
num_rowsMethod · 0.45

Tested by

no test coverage detected