Repository: parquet-cpp Updated Branches: refs/heads/master ff14d97ef -> b7b7fa22f
PARQUET-597: Add data rates to benchmark output Author: Uwe L. Korn <[email protected]> Closes #94 from xhochy/parquet-597 and squashes the following commits: 6442eb7 [Uwe L. Korn] PARQUET-597: Add data rates to benchmark output Project: http://git-wip-us.apache.org/repos/asf/parquet-cpp/repo Commit: http://git-wip-us.apache.org/repos/asf/parquet-cpp/commit/b7b7fa22 Tree: http://git-wip-us.apache.org/repos/asf/parquet-cpp/tree/b7b7fa22 Diff: http://git-wip-us.apache.org/repos/asf/parquet-cpp/diff/b7b7fa22 Branch: refs/heads/master Commit: b7b7fa22f05ede2593e93c0f32564235e4404e83 Parents: ff14d97 Author: Uwe L. Korn <[email protected]> Authored: Tue May 3 17:41:34 2016 -0700 Committer: Wes McKinney <[email protected]> Committed: Tue May 3 17:41:34 2016 -0700 ---------------------------------------------------------------------- src/parquet/column/column-io-benchmark.cc | 13 +++++++++++++ src/parquet/encodings/encoding-benchmark.cc | 4 ++++ 2 files changed, 17 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/b7b7fa22/src/parquet/column/column-io-benchmark.cc ---------------------------------------------------------------------- diff --git a/src/parquet/column/column-io-benchmark.cc b/src/parquet/column/column-io-benchmark.cc index 8007ed5..3bc2582 100644 --- a/src/parquet/column/column-io-benchmark.cc +++ b/src/parquet/column/column-io-benchmark.cc @@ -44,6 +44,17 @@ std::shared_ptr<ColumnDescriptor> Int64Schema(Repetition::type repetition) { node, repetition != Repetition::REQUIRED, repetition == Repetition::REPEATED); } +void SetBytesProcessed(::benchmark::State& state, Repetition::type repetition) { + int64_t bytes_processed = state.iterations() * state.range_x() * sizeof(int64_t); + if (repetition != Repetition::REQUIRED) { + bytes_processed += state.iterations() * state.range_x() * sizeof(int16_t); + } + if (repetition == Repetition::REPEATED) { + bytes_processed += state.iterations() * state.range_x() * sizeof(int16_t); + } + state.SetBytesProcessed(state.iterations() * state.range_x() * sizeof(int16_t)); +} + template <Repetition::type repetition> static void BM_WriteInt64Column(::benchmark::State& state) { format::ColumnChunk metadata; @@ -60,6 +71,7 @@ static void BM_WriteInt64Column(::benchmark::State& state) { values.size(), definition_levels.data(), repetition_levels.data(), values.data()); writer->Close(); } + SetBytesProcessed(state, repetition); } BENCHMARK_TEMPLATE(BM_WriteInt64Column, Repetition::REQUIRED)->Range(1024, 65536); @@ -103,6 +115,7 @@ static void BM_ReadInt64Column(::benchmark::State& state) { repetition_levels_out.data(), values_out.data(), &values_read); } } + SetBytesProcessed(state, repetition); } BENCHMARK_TEMPLATE(BM_ReadInt64Column, Repetition::REQUIRED) http://git-wip-us.apache.org/repos/asf/parquet-cpp/blob/b7b7fa22/src/parquet/encodings/encoding-benchmark.cc ---------------------------------------------------------------------- diff --git a/src/parquet/encodings/encoding-benchmark.cc b/src/parquet/encodings/encoding-benchmark.cc index 92bc29e..f9265bd 100644 --- a/src/parquet/encodings/encoding-benchmark.cc +++ b/src/parquet/encodings/encoding-benchmark.cc @@ -31,6 +31,7 @@ static void BM_PlainEncodingBoolean(::benchmark::State& state) { InMemoryOutputStream dst; encoder.Encode(values, values.size(), &dst); } + state.SetBytesProcessed(state.iterations() * state.range_x() * sizeof(bool)); } BENCHMARK(BM_PlainEncodingBoolean)->Range(1024, 65536); @@ -49,6 +50,7 @@ static void BM_PlainDecodingBoolean(::benchmark::State& state) { decoder.Decode(output, values.size()); } + state.SetBytesProcessed(state.iterations() * state.range_x() * sizeof(bool)); delete[] output; } @@ -62,6 +64,7 @@ static void BM_PlainEncodingInt64(::benchmark::State& state) { InMemoryOutputStream dst; encoder.Encode(values.data(), values.size(), &dst); } + state.SetBytesProcessed(state.iterations() * state.range_x() * sizeof(int64_t)); } BENCHMARK(BM_PlainEncodingInt64)->Range(1024, 65536); @@ -78,6 +81,7 @@ static void BM_PlainDecodingInt64(::benchmark::State& state) { decoder.SetData(values.size(), buf->data(), buf->size()); decoder.Decode(values.data(), values.size()); } + state.SetBytesProcessed(state.iterations() * state.range_x() * sizeof(int64_t)); } BENCHMARK(BM_PlainDecodingInt64)->Range(1024, 65536);
