jianxind commented on a change in pull request #7213:
URL: https://github.com/apache/arrow/pull/7213#discussion_r426976016
##########
File path: cpp/src/parquet/encoding_benchmark.cc
##########
@@ -199,6 +200,153 @@ static void BM_PlainDecodingFloat(benchmark::State&
state) {
BENCHMARK(BM_PlainDecodingFloat)->Range(MIN_RANGE, MAX_RANGE);
+static void BM_PlainSpacedArgs(benchmark::internal::Benchmark* bench) {
+ static const auto BM_kPlainSpacedSize =
+ arrow::internal::CpuInfo::GetInstance()->CacheSize(
+ arrow::internal::CpuInfo::L1_CACHE);
+
+ bench->Args({/*size*/ BM_kPlainSpacedSize, /*null_percentage=*/1});
+ bench->Args({/*size*/ BM_kPlainSpacedSize, /*null_percentage=*/10});
+ bench->Args({/*size*/ BM_kPlainSpacedSize, /*null_percentage=*/50});
+}
+
+static void BM_PlainEncodingSpacedBoolean(benchmark::State& state) {
+ const auto num_values = state.range(0);
+ const double null_percent = static_cast<double>(state.range(1)) / 100.0;
+
+ const auto values = new bool[num_values];
Review comment:
Unlike the Put which support both T* and vector inputs, current
PutSpaced only has interface to T*. I has to use bool[] here, it still need
convert to bool* if using std::vector<bool>.
virtual void Put(const T* src, int num_values) = 0;
virtual void Put(const std::vector<T>& src, int num_values = -1);
virtual void PutSpaced(const T* src, int num_values, const uint8_t*
valid_bits,
int64_t valid_bits_offset) = 0;
Another alternate way is std::vector<uint8_t> instead, and reinterpret_cast
the data of std::vector<uint8_t> to bool?
----------------------------------------------------------------
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]