pitrou commented on code in PR #15140:
URL: https://github.com/apache/arrow/pull/15140#discussion_r1060528794


##########
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); });

Review Comment:
   Call this `length` for clarity.
   ```suggestion
         state, [](size_t length) { return std::vector<int32_t>(length, 64); });
   ```



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to