Skip to content

Commit

Permalink
chore: reduce the number of benchmarks (#324)
Browse files Browse the repository at this point in the history
  • Loading branch information
mbrobbel authored Feb 3, 2025
1 parent 7d3432a commit 91412d1
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions benches/narrow/versus/arrow/primitive.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use arrow_array::types::{UInt16Type, UInt32Type, UInt64Type, UInt8Type};
use arrow_array::types::{UInt64Type, UInt8Type};
use arrow_array::{builder::PrimitiveBuilder, ArrowPrimitiveType, PrimitiveArray};
use criterion::{BenchmarkId, Criterion};
use narrow::{array::FixedSizePrimitiveArray, FixedSize};
Expand All @@ -9,12 +9,8 @@ use std::{ops::Rem, time::Duration};

pub fn bench(c: &mut Criterion) {
bench_primitive::<UInt8Type>(c);
bench_primitive::<UInt16Type>(c);
bench_primitive::<UInt32Type>(c);
bench_primitive::<UInt64Type>(c);
bench_nullable_primitive::<UInt8Type>(c);
bench_nullable_primitive::<UInt16Type>(c);
bench_nullable_primitive::<UInt32Type>(c);
bench_nullable_primitive::<UInt64Type>(c);
}

Expand All @@ -33,7 +29,8 @@ where
.unwrap()
.saturating_add(1);

for size in [0, 8, 16].map(|v| 1usize << v).into_iter() {
#[allow(clippy::single_element_loop)]
for size in [8].map(|v| 1usize << v).into_iter() {
let input = (0..size)
.map(|v| num_traits::cast(v % max).unwrap())
.collect::<Vec<T::Native>>();
Expand Down Expand Up @@ -96,8 +93,10 @@ where
.saturating_add(1);
let mut rng = SmallRng::seed_from_u64(1337);

for size in [0, 4, 8, 16].map(|v| 1usize << v).into_iter() {
for null_fraction in [0., 0.5, 1.] {
#[allow(clippy::single_element_loop)]
for size in [8].map(|v| 1usize << v).into_iter() {
#[allow(clippy::single_element_loop)]
for null_fraction in [0.5] {
let input = (0..size)
.map(|v| num_traits::cast(v % max).unwrap())
.map(|v| rng.random_bool(1. - null_fraction).then_some(v))
Expand Down

0 comments on commit 91412d1

Please sign in to comment.