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 2020/09/03 11:36:21 UTC

[GitHub] [arrow] pitrou commented on a change in pull request #8103: ARROW-9904: [C++] Unroll the loop of CountSetBits.

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



##########
File path: cpp/src/arrow/compute/kernels/aggregate_benchmark.cc
##########
@@ -398,5 +398,17 @@ MINMAX_KERNEL_BENCHMARK(MinMaxKernelInt16, Int16Type);
 MINMAX_KERNEL_BENCHMARK(MinMaxKernelInt32, Int32Type);
 MINMAX_KERNEL_BENCHMARK(MinMaxKernelInt64, Int64Type);
 
+static void CountKernelBenchInt64(benchmark::State& state) {
+  RegressionArgs args(state);
+  const int64_t array_size = args.size / sizeof(int64_t);
+  auto rand = random::RandomArrayGenerator(1923);
+  auto array = rand.Numeric<Int64Type>(array_size, -100, 100, args.null_proportion);
+
+  for (auto _ : state) {
+    ABORT_NOT_OK(Count(array).status());

Review comment:
       The null count is only computed once and then cached on the array, so this benchmark isn't correct.




----------------------------------------------------------------
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:
users@infra.apache.org