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/06/09 16:06:27 UTC

[GitHub] [arrow] jianxind commented on a change in pull request #7382: ARROW-5760: [C++] New compute::Take implementation for better performance, faster dispatch, smaller code size / faster compilation

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



##########
File path: cpp/src/arrow/compute/benchmark_util.h
##########
@@ -77,12 +77,18 @@ struct RegressionArgs {
   const int64_t size;
 
   // proportion of nulls in generated arrays
-  const double null_proportion;
+  double null_proportion;
 
   explicit RegressionArgs(benchmark::State& state)
       : size(state.range(0)),
-        null_proportion(std::min(1., 1. / static_cast<double>(state.range(1)))),
-        state_(state) {}
+        null_proportion(),
+        state_(state) {
+    if (state.range(1) == 0) {
+      this->null_proportion = 0.0;
+    } else {
+      this->null_proportion = std::min(1., 1. / static_cast<double>(state.range(1)));
+    }
+  }
 

Review comment:
       Can the new zero null percent added to pre-built list of BenchmarkSetArgsWithSizes also?
     void BenchmarkSetArgsWithSizes(benchmark::internal::Benchmark* bench,
        ...
        for (auto nulls : std::vector<ArgsType>({10000, 1000, 100, 50, 10, 1})), add a 0?




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