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

fix: take_run benchmark parameter #3679

Merged
merged 1 commit into from
Feb 9, 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
6 changes: 3 additions & 3 deletions arrow/benches/primitive_run_take.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,14 +24,14 @@ use arrow_array::UInt32Array;
use criterion::{criterion_group, criterion_main, Criterion};
use rand::Rng;

fn create_random_index(size: usize, null_density: f32) -> UInt32Array {
fn create_random_index(size: usize, null_density: f32, max_value: usize) -> UInt32Array {
let mut rng = seedable_rng();
let mut builder = UInt32Builder::with_capacity(size);
for _ in 0..size {
if rng.gen::<f32>() < null_density {
builder.append_null();
} else {
let value = rng.gen_range::<u32, _>(0u32..size as u32);
let value = rng.gen_range::<u32, _>(0u32..max_value as u32);
builder.append_value(value);
}
}
Expand All @@ -48,7 +48,7 @@ fn criterion_benchmark(c: &mut Criterion) {
logical_array_len,
physical_array_len,
);
let indices = create_random_index(take_len, 0.0);
let indices = create_random_index(take_len, 0.0, logical_array_len);
group.bench_function(
format!(
"(run_array_len:{logical_array_len}, physical_array_len:{physical_array_len}, take_len:{take_len})"),
Expand Down