You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by we...@apache.org on 2023/03/24 14:04:37 UTC

[arrow] branch main updated: GH-33957: [C++] Add Rank chunked array benchmarks (#34602)

This is an automated email from the ASF dual-hosted git repository.

westonpace pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/main by this push:
     new 071ea1bc24 GH-33957: [C++] Add Rank chunked array benchmarks (#34602)
071ea1bc24 is described below

commit 071ea1bc245446f6ee257bb1ed7d056c46c2868e
Author: Dinir Imameev <bs...@gmail.com>
AuthorDate: Fri Mar 24 17:04:29 2023 +0300

    GH-33957: [C++] Add Rank chunked array benchmarks (#34602)
    
    
    
    ### What changes are included in this PR?
    rank benchmarks for chunked arrays
    
    ### Are these changes tested?
    Not required
    
    * Closes: #33957
    
    Authored-by: Dinir Imameev <di...@gmail.com>
    Signed-off-by: Weston Pace <we...@gmail.com>
---
 cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc | 16 ++++++++++++++++
 1 file changed, 16 insertions(+)

diff --git a/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc b/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc
index 2dec0e60d6..14ae363d91 100644
--- a/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc
+++ b/cpp/src/arrow/compute/kernels/vector_sort_benchmark.cc
@@ -55,6 +55,10 @@ struct RankRunner {
   Status operator()(const std::shared_ptr<Array>& values) const {
     return CallFunction("rank", {values}, &options).status();
   }
+
+  Status operator()(const std::shared_ptr<ChunkedArray>& values) const {
+    return CallFunction("rank", {values}, &options).status();
+  }
 };
 
 template <typename Runner, typename ArrayLike>
@@ -114,6 +118,10 @@ static void ArrayRankInt64Narrow(benchmark::State& state) {
   ArraySortFuncInt64Benchmark(state, RankRunner(state), -100, 100);
 }
 
+static void ChunkedArrayRankInt64Narrow(benchmark::State& state) {
+  ChunkedArraySortFuncInt64Benchmark(state, RankRunner(state), -100, 100);
+}
+
 static void ArraySortIndicesInt64Wide(benchmark::State& state) {
   const auto min = std::numeric_limits<int64_t>::min();
   const auto max = std::numeric_limits<int64_t>::max();
@@ -126,6 +134,12 @@ static void ArrayRankInt64Wide(benchmark::State& state) {
   ArraySortFuncInt64Benchmark(state, RankRunner(state), min, max);
 }
 
+static void ChunkedArrayRankInt64Wide(benchmark::State& state) {
+  const auto min = std::numeric_limits<int64_t>::min();
+  const auto max = std::numeric_limits<int64_t>::max();
+  ChunkedArraySortFuncInt64Benchmark(state, RankRunner(state), min, max);
+}
+
 static void ArraySortIndicesBool(benchmark::State& state) {
   ArraySortFuncBoolBenchmark(state, SortRunner(state));
 }
@@ -365,6 +379,8 @@ void ArrayRankSetArgs(benchmark::internal::Benchmark* bench) {
 
 BENCHMARK(ArrayRankInt64Narrow)->Apply(ArrayRankSetArgs);
 BENCHMARK(ArrayRankInt64Wide)->Apply(ArrayRankSetArgs);
+BENCHMARK(ChunkedArrayRankInt64Narrow)->Apply(ArrayRankSetArgs);
+BENCHMARK(ChunkedArrayRankInt64Wide)->Apply(ArrayRankSetArgs);
 
 }  // namespace compute
 }  // namespace arrow