Skip to content

Commit

Permalink
add filter_kernel benchmark for run array (#6706)
Browse files Browse the repository at this point in the history
  • Loading branch information
delamarch3 authored Nov 10, 2024
1 parent 24f455e commit 28878d3
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion arrow/benches/filter_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ use arrow::util::bench_util::*;

use arrow::array::*;
use arrow::compute::filter;
use arrow::datatypes::{Field, Float32Type, Int32Type, Schema, UInt8Type};
use arrow::datatypes::{Field, Float32Type, Int32Type, Int64Type, Schema, UInt8Type};

use arrow_array::types::Decimal128Type;
use criterion::{criterion_group, criterion_main, Criterion};
Expand Down Expand Up @@ -283,6 +283,17 @@ fn add_benchmark(c: &mut Criterion) {
"filter context mixed string view low selectivity (kept 1/1024)",
|b| b.iter(|| bench_built_filter(&sparse_filter, &data_array)),
);

let data_array = create_primitive_run_array::<Int32Type, Int64Type>(size, size);
c.bench_function("filter run array (kept 1/2)", |b| {
b.iter(|| bench_built_filter(&filter, &data_array))
});
c.bench_function("filter run array high selectivity (kept 1023/1024)", |b| {
b.iter(|| bench_built_filter(&dense_filter, &data_array))
});
c.bench_function("filter run array low selectivity (kept 1/1024)", |b| {
b.iter(|| bench_built_filter(&sparse_filter, &data_array))
});
}

criterion_group!(benches, add_benchmark);
Expand Down

0 comments on commit 28878d3

Please sign in to comment.