Skip to content
Open
Show file tree
Hide file tree
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions vortex-array/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ vortex-array = { path = ".", features = [
"table-display",
"unstable_row_fns",
] }
vortex-bench-support = { workspace = true }

[[bench]]
name = "aggregate_max"
Expand Down
28 changes: 28 additions & 0 deletions vortex-array/benches/take_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ fn main() {
/// Number of indices to take. The top tier is sized to keep CodSpeed simulation under 1ms.
const NUM_INDICES: &[usize] = &[1_000, 10_000, 25_000];

/// Large enough to measure both cache-resident and streaming dictionary decoding.
const GT_NUM_INDICES: &[usize] = &[1_000_000, 16_000_000];

/// Size of the source vector / dictionary values.
const VECTOR_SIZE: &[usize] = &[16, 256, 2048, 8192];

Expand Down Expand Up @@ -90,3 +93,28 @@ fn dict_canonicalize_zipfian<const NUM_VALUES: usize>(bencher: Bencher, num_indi
.with_inputs(|| (&dict, SESSION.create_execution_ctx()))
.bench_refs(|(dict, ctx)| (*dict).clone().into_array().execute::<Canonical>(ctx));
}

/// StatPopGen GT distribution: 75.21% 0, 3.85% 1, 0.45% 2, and 20.49% null.
#[vortex_bench_support::cpu_features]
#[divan::bench(args = GT_NUM_INDICES)]
fn dict_canonicalize_gt_u8(bencher: Bencher, num_indices: usize) {
let values = PrimitiveArray::from_option_iter([Some(0u8), Some(1), Some(2), None]);
let range = Uniform::new(0u16, 10_000).unwrap();
let codes = PrimitiveArray::from_iter(
StdRng::seed_from_u64(0)
.sample_iter(range)
.take(num_indices)
.map(|sample| match sample {
0..7521 => 0u8,
7521..7906 => 1,
7906..7951 => 2,
_ => 3,
}),
);
let dict = DictArray::try_new(codes.into_array(), values.into_array()).unwrap();

bencher
.counter(ItemsCount::new(num_indices))
.with_inputs(|| (&dict, SESSION.create_execution_ctx()))
.bench_refs(|(dict, ctx)| (*dict).clone().into_array().execute::<Canonical>(ctx));
}
Loading