bkmgit commented on a change in pull request #11882:
URL: https://github.com/apache/arrow/pull/11882#discussion_r782784767



##########
File path: cpp/src/arrow/compute/kernels/scalar_compare_benchmark.cc
##########
@@ -77,5 +77,44 @@ BENCHMARK(GreaterArrayScalarInt64)->Apply(RegressionSetArgs);
 BENCHMARK(GreaterArrayArrayString)->Apply(RegressionSetArgs);
 BENCHMARK(GreaterArrayScalarString)->Apply(RegressionSetArgs);
 
+template <typename Type>
+static void BetweenScalarArrayScalar(benchmark::State& state) {
+  RegressionArgs args(state, /*size_is_bytes=*/false);
+  auto ty = TypeTraits<Type>::type_singleton();
+  auto rand = random::RandomArrayGenerator(kSeed);
+  auto array = rand.ArrayOf(ty, args.size, args.null_proportion);
+  auto scalar_left = *rand.ArrayOf(ty, 1, 0)->GetScalar(0);
+  auto scalar_right = *rand.ArrayOf(ty, 1, 0)->GetScalar(0);
+  for (auto _ : state) {
+    ABORT_NOT_OK(
+        CallFunction("between_less_equal_less_equal", {array, scalar_left, 
scalar_right})
+            .status());
+  }
+}
+
+template <typename Type>
+static void BetweenArrayArrayArray(benchmark::State& state) {
+  RegressionArgs args(state, /*size_is_bytes=*/false);
+  auto ty = TypeTraits<Type>::type_singleton();
+  auto rand = random::RandomArrayGenerator(kSeed);
+  auto lhs = rand.ArrayOf(ty, args.size, args.null_proportion);
+  auto mid = rand.ArrayOf(ty, args.size, args.null_proportion);
+  auto rhs = rand.ArrayOf(ty, args.size, args.null_proportion);
+  for (auto _ : state) {
+    ABORT_NOT_OK(CallFunction("between_less_equal_less_equal", {mid, lhs, 
rhs}).status());
+  }
+}
+
+// static void BetweenArrayArrayArrayInt64(benchmark::State& state) {
+//   BetweenArrayArrayArray<Int64Type>(state);
+// }
+//
+// static void BetweenScalarArrayScalarInt64(benchmark::State& state) {
+//   BetweenScalarArrayScalar<Int64Type>(state);
+// }
+
+// BENCHMARK(BetweenArrayArrayArrayInt64)->Apply(RegressionSetArgs);
+// BENCHMARK(BetweenScalarArrayScalarInt64)->Apply(RegressionSetArgs);

Review comment:
       Working now. Thanks.




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

To unsubscribe, e-mail: github-unsubscr...@arrow.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to