You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@arrow.apache.org by tu...@apache.org on 2023/06/13 12:03:30 UTC

[arrow-rs] branch master updated: More take benchmarks (#4403)

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

tustvold pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/arrow-rs.git


The following commit(s) were added to refs/heads/master by this push:
     new 4fc05636b More take benchmarks (#4403)
4fc05636b is described below

commit 4fc05636b10de39a3167819f235768820837bac3
Author: Raphael Taylor-Davies <17...@users.noreply.github.com>
AuthorDate: Tue Jun 13 13:03:22 2023 +0100

    More take benchmarks (#4403)
---
 arrow/benches/take_kernels.rs | 43 +++++++++++++++++++++++++++----------------
 1 file changed, 27 insertions(+), 16 deletions(-)

diff --git a/arrow/benches/take_kernels.rs b/arrow/benches/take_kernels.rs
index 731426031..362b3f5cb 100644
--- a/arrow/benches/take_kernels.rs
+++ b/arrow/benches/take_kernels.rs
@@ -56,11 +56,26 @@ fn add_benchmark(c: &mut Criterion) {
     let values = create_primitive_array::<Int32Type>(512, 0.0);
     let indices = create_random_index(512, 0.0);
     c.bench_function("take i32 512", |b| b.iter(|| bench_take(&values, &indices)));
+
     let values = create_primitive_array::<Int32Type>(1024, 0.0);
     let indices = create_random_index(1024, 0.0);
     c.bench_function("take i32 1024", |b| {
         b.iter(|| bench_take(&values, &indices))
     });
+    let indices = create_random_index(1024, 0.5);
+    c.bench_function("take i32 null indices 1024", |b| {
+        b.iter(|| bench_take(&values, &indices))
+    });
+
+    let values = create_primitive_array::<Int32Type>(1024, 0.5);
+    let indices = create_random_index(1024, 0.0);
+    c.bench_function("take i32 null values 1024", |b| {
+        b.iter(|| bench_take(&values, &indices))
+    });
+    let indices = create_random_index(1024, 0.5);
+    c.bench_function("take i32 null values null indices 1024", |b| {
+        b.iter(|| bench_take(&values, &indices))
+    });
 
     let values = create_primitive_array::<Int32Type>(512, 0.0);
     let indices = create_random_index(512, 0.0);
@@ -73,35 +88,32 @@ fn add_benchmark(c: &mut Criterion) {
         b.iter(|| bench_take_bounds_check(&values, &indices))
     });
 
-    let indices = create_random_index(512, 0.5);
-    c.bench_function("take i32 nulls 512", |b| {
-        b.iter(|| bench_take(&values, &indices))
-    });
-    let values = create_primitive_array::<Int32Type>(1024, 0.0);
-    let indices = create_random_index(1024, 0.5);
-    c.bench_function("take i32 nulls 1024", |b| {
-        b.iter(|| bench_take(&values, &indices))
-    });
-
     let values = create_boolean_array(512, 0.0, 0.5);
     let indices = create_random_index(512, 0.0);
     c.bench_function("take bool 512", |b| {
         b.iter(|| bench_take(&values, &indices))
     });
+
     let values = create_boolean_array(1024, 0.0, 0.5);
     let indices = create_random_index(1024, 0.0);
     c.bench_function("take bool 1024", |b| {
         b.iter(|| bench_take(&values, &indices))
     });
 
-    let values = create_boolean_array(512, 0.0, 0.5);
-    let indices = create_random_index(512, 0.5);
-    c.bench_function("take bool nulls 512", |b| {
+    let indices = create_random_index(1024, 0.5);
+    c.bench_function("take bool null indices 1024", |b| {
         b.iter(|| bench_take(&values, &indices))
     });
-    let values = create_boolean_array(1024, 0.0, 0.5);
+
+    let values = create_boolean_array(1024, 0.5, 0.5);
+    let indices = create_random_index(1024, 0.0);
+    c.bench_function("take bool null values 1024", |b| {
+        b.iter(|| bench_take(&values, &indices))
+    });
+
+    let values = create_boolean_array(1024, 0.5, 0.5);
     let indices = create_random_index(1024, 0.5);
-    c.bench_function("take bool nulls 1024", |b| {
+    c.bench_function("take bool null values null indices 1024", |b| {
         b.iter(|| bench_take(&values, &indices))
     });
 
@@ -128,7 +140,6 @@ fn add_benchmark(c: &mut Criterion) {
     });
 
     let values = create_string_array::<i32>(1024, 0.5);
-
     let indices = create_random_index(1024, 0.0);
     c.bench_function("take str null values 1024", |b| {
         b.iter(|| bench_take(&values, &indices))