Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GH-39666: [C++] Ensure CSV and JSON benchmarks present a bytes/s or items/s metric #39764

Merged
merged 1 commit into from
Jan 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion cpp/src/arrow/csv/writer_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void BenchmarkWriteCsv(benchmark::State& state, const WriteOptions& options,
const RecordBatch& batch) {
int64_t total_size = 0;

while (state.KeepRunning()) {
for (auto _ : state) {
auto out = io::BufferOutputStream::Create().ValueOrDie();
ABORT_NOT_OK(WriteCSV(batch, options, out.get()));
auto buffer = out->Finish().ValueOrDie();
Expand All @@ -106,6 +106,7 @@ void BenchmarkWriteCsv(benchmark::State& state, const WriteOptions& options,

// byte size of the generated csv dataset
state.SetBytesProcessed(total_size);
state.SetItemsProcessed(state.iterations() * batch.num_columns() * batch.num_rows());
state.counters["null_percent"] = static_cast<double>(state.range(0));
}

Expand Down
Loading