pitrou commented on a change in pull request #7213:
URL: https://github.com/apache/arrow/pull/7213#discussion_r427099731



##########
File path: cpp/src/parquet/encoding_benchmark.cc
##########
@@ -199,6 +200,130 @@ static void BM_PlainDecodingFloat(benchmark::State& 
state) {
 
 BENCHMARK(BM_PlainDecodingFloat)->Range(MIN_RANGE, MAX_RANGE);
 
+template <typename ParquetType>
+struct BM_SpacedEncodingTraits;
+
+template <>
+struct BM_SpacedEncodingTraits<BooleanType> {
+  // Leverage UInt8 vector array data for Boolean, the input src of PutSpaced 
is bool*
+  using ArrowType = ::arrow::UInt8Type;
+  using ArrayType = ::arrow::UInt8Array;
+  using CType = bool;
+};
+
+template <>
+struct BM_SpacedEncodingTraits<FloatType> {
+  using ArrowType = typename EncodingTraits<FloatType>::ArrowType;
+  using ArrayType = typename arrow::TypeTraits<ArrowType>::ArrayType;
+  using CType = typename FloatType::c_type;
+};
+
+template <>
+struct BM_SpacedEncodingTraits<DoubleType> {

Review comment:
       Instead of repeating yourself here, you could make this the default 
`BM_SpacedEncodingTraits`.




----------------------------------------------------------------
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.

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


Reply via email to