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/04 02:02:35 UTC

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

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



##########
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:
       Indeed it's computed again every time. The exec engine runs on batch iteration though for this case only one batch actually occurs. Each iteration use Slice to fetch the part of input array.
   See https://github.com/apache/arrow/blob/master/cpp/src/arrow/compute/exec.cc#L174




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