Skip to content

Commit

Permalink
Fix benchmark
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Jan 8, 2025
1 parent 313ce5e commit 1b82cd3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
18 changes: 9 additions & 9 deletions cpp/src/parquet/arrow/size_stats_benchmark.cc
Original file line number Diff line number Diff line change
Expand Up @@ -95,13 +95,15 @@ void WriteColumn(::benchmark::State& state, const std::shared_ptr<::arrow::Table
std::static_pointer_cast<::arrow::io::OutputStream>(output),
DEFAULT_MAX_ROW_GROUP_LENGTH, properties));

state.PauseTiming();

auto metadata = parquet::ReadMetaData(
std::make_shared<::arrow::io::BufferReader>(output->Finish().ValueOrDie()));
state.counters["output_size"] = static_cast<double>(output->Tell().ValueOrDie());
state.counters["page_index_size"] =
static_cast<double>(GetTotalPageIndexSize(metadata));
if (state.counters.find("page_index_size") == state.counters.end()) {
state.PauseTiming();
auto metadata = parquet::ReadMetaData(
std::make_shared<::arrow::io::BufferReader>(output->Finish().ValueOrDie()));
state.counters["output_size"] = static_cast<double>(output->Tell().ValueOrDie());
state.counters["page_index_size"] =
static_cast<double>(GetTotalPageIndexSize(metadata));
state.ResumeTiming();
}
}

state.SetItemsProcessed(state.iterations() * kBenchmarkSize);
Expand Down Expand Up @@ -158,5 +160,3 @@ BENCHMARK_TEMPLATE(BM_WriteListColumn, SizeStatisticsLevel::PageAndColumnChunk,
::arrow::StringType);

} // namespace parquet::benchmark

BENCHMARK_MAIN();

0 comments on commit 1b82cd3

Please sign in to comment.