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

add filter benchmark for FixedSizeBinaryArray #6186

Merged
merged 1 commit into from
Aug 3, 2024
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: 43 additions & 0 deletions arrow/benches/filter_kernels.rs
Original file line number Diff line number Diff line change
Expand Up @@ -204,6 +204,49 @@ fn add_benchmark(c: &mut Criterion) {
|b| b.iter(|| bench_built_filter(&sparse_filter, &data_array)),
);

let mut add_benchmark_for_fsb_with_length = |value_length: usize| {
let data_array = create_fsb_array(size, 0.0, value_length);
c.bench_function(
format!("filter fsb with value length {value_length} (kept 1/2)").as_str(),
|b| b.iter(|| bench_filter(&data_array, &filter_array)),
);
c.bench_function(
format!(
"filter fsb with value length {value_length} high selectivity (kept 1023/1024)"
)
.as_str(),
|b| b.iter(|| bench_filter(&data_array, &dense_filter_array)),
);
c.bench_function(
format!("filter fsb with value length {value_length} low selectivity (kept 1/1024)")
.as_str(),
|b| b.iter(|| bench_filter(&data_array, &sparse_filter_array)),
);

c.bench_function(
format!("filter context fsb with value length {value_length} (kept 1/2)").as_str(),
|b| b.iter(|| bench_built_filter(&filter, &filter_array)),
);
c.bench_function(
format!(
"filter context fsb with value length {value_length} high selectivity (kept 1023/1024)"
)
.as_str(),
|b| b.iter(|| bench_built_filter(&filter, &dense_filter_array)),
);
c.bench_function(
format!(
"filter context fsb with value length {value_length} low selectivity (kept 1/1024)"
)
.as_str(),
|b| b.iter(|| bench_built_filter(&filter, &sparse_filter_array)),
);
};

add_benchmark_for_fsb_with_length(5);
add_benchmark_for_fsb_with_length(20);
add_benchmark_for_fsb_with_length(50);

let data_array = create_primitive_array::<Float32Type>(size, 0.0);

let field = Field::new("c1", data_array.data_type().clone(), true);
Expand Down
Loading