Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More take benchmarks #4403

Merged
merged 1 commit into from
Jun 13, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 27 additions & 16 deletions arrow/benches/take_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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))
});

Expand All @@ -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))
Expand Down