You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@arrow.apache.org by GitBox <gi...@apache.org> on 2023/01/03 12:12:40 UTC
[GitHub] [arrow] pitrou commented on a diff in pull request #15140: GH-14951: [C++][Parquet] Support Benchmark for DELTA_BINARY_PACKED
pitrou commented on code in PR #15140:
URL: https://github.com/apache/arrow/pull/15140#discussion_r1060528050
##########
cpp/src/parquet/encoding_benchmark.cc:
##########
@@ -452,6 +452,134 @@ BENCHMARK(BM_ByteStreamSplitEncode_Float_Avx512)->Range(MIN_RANGE, MAX_RANGE);
BENCHMARK(BM_ByteStreamSplitEncode_Double_Avx512)->Range(MIN_RANGE, MAX_RANGE);
#endif
+template <typename DType, typename NumberGenerator>
+static void BM_DeltaBitPackingEncode(benchmark::State& state, NumberGenerator gen) {
+ using T = typename DType::c_type;
+ std::vector<T> values = gen(state.range(0));
+ std::vector<uint8_t> output(state.range(0) * sizeof(T), 0);
+ auto encoder = MakeTypedEncoder<DType>(Encoding::DELTA_BINARY_PACKED);
+ for (auto _ : state) {
+ encoder->Put(values.data(), static_cast<int>(values.size()));
+ encoder->FlushValues();
+ }
+ state.SetBytesProcessed(state.iterations() * values.size() * sizeof(T));
+}
+
+static void BM_DeltaBitPackingEncode_Int32_Equals(benchmark::State& state) {
+ BM_DeltaBitPackingEncode<Int32Type>(
+ state, [](size_t number) { return std::vector<int32_t>(number, 64); });
+}
+
+static void BM_DeltaBitPackingEncode_Int64_Equals(benchmark::State& state) {
Review Comment:
Do we expect different performance on this than on narrow data? Otherwise we might as well not bother.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: github-unsubscribe@arrow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org