Skip to content
Merged
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 vortex-array/benches/aggregate_grouped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/aggregate_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,18 @@ use divan::Bencher;
use rand::prelude::*;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::PrimitiveArray;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

const N: usize = 100_000;

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench]
fn max_i32(bencher: Bencher) {
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/aggregate_sum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,19 @@ use divan::Bencher;
use rand::prelude::*;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::expr::stats::Stat;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

const N: usize = 100_000;

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench]
fn sum_i32(bencher: Bencher) {
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/binary_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use vortex_array::ArrayRef;
use vortex_array::Executable;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::BoolArray;
use vortex_array::arrays::ConstantArray;
use vortex_array::arrays::PrimitiveArray;
Expand All @@ -23,10 +24,11 @@ use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

const LEN: usize = 65_536;

Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/bool_zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,18 @@ use vortex_array::ArrayRef;
use vortex_array::IntoArray;
use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::BoolArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_mask::Mask;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

const LEN: usize = 65_536;

Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/cast_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ use rand::prelude::*;
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::dtype::DType;
Expand All @@ -19,14 +20,15 @@ use vortex_array::expr::stats::Stat;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

// Sizes used for the fallible-path benches below. Kept small enough to fit in L2 so
// the kernel cost shows up clearly rather than being hidden by DRAM bandwidth.
const SIZES: &[usize] = &[65_536];

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench(args = SIZES)]
fn cast_u16_to_u32(bencher: Bencher, n: usize) {
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/chunk_array_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use vortex_array::ArrayRef;
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::BoolArray;
use vortex_array::arrays::ChunkedArray;
use vortex_array::arrays::ConstantArray;
Expand All @@ -22,6 +23,7 @@ use vortex_error::VortexExpect;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

Expand All @@ -32,7 +34,7 @@ const BENCH_ARGS: &[(usize, usize)] = &[
(1000, 10),
];

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench(args = BENCH_ARGS)]
fn chunked_bool_canonical_into(bencher: Bencher, (len, chunk_count): (usize, usize)) {
Expand Down
1 change: 1 addition & 0 deletions vortex-array/benches/chunked_dict_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ use vortex_error::VortexExpect;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/chunked_fsl_canonicalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,19 @@ use divan::Bencher;
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::ChunkedArray;
use vortex_array::arrays::FixedSizeListArray;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

/// Number of lists in each chunk.
const LISTS_PER_CHUNK: usize = 1_000;
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/dict_compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::ConstantArray;
use vortex_array::arrays::VarBinArray;
use vortex_array::arrays::VarBinViewArray;
Expand All @@ -24,10 +25,11 @@ use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

const LENGTH_AND_UNIQUE_VALUES: &[(usize, usize)] = &[
// length, unique_values
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/dict_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use rand::distr::StandardUniform;
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::VarBinArray;
use vortex_array::arrays::VarBinViewArray;
use vortex_array::arrays::dict_test::gen_primitive_for_dict;
Expand All @@ -20,6 +21,7 @@ use vortex_array::dtype::NativePType;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

Expand All @@ -37,7 +39,7 @@ const BENCH_ARGS: &[(usize, usize)] = &[
(10_000, 512),
];

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench(types = [u8, f32, i64], args = BENCH_ARGS)]
fn encode_primitives<T>(bencher: Bencher, (len, unique_values): (usize, usize))
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/expr/case_when_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ use vortex_array::ArrayRef;
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::BoolArray;
use vortex_array::arrays::StructArray;
use vortex_array::expr::case_when;
Expand All @@ -25,9 +26,10 @@ use vortex_array::expr::root;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/filter_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,16 +18,18 @@ use rand::prelude::*;
use rand_distr::Zipf;
use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::BoolArray;
use vortex_buffer::BitBuffer;
use vortex_mask::Mask;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

const SIZES: &[usize] = &[1_000, 10_000, 100_000, 250_000];
const DENSITY_SWEEP_SIZE: usize = 100_000;
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/listview_rebuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use divan::Bencher;
use vortex_array::Canonical;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::FixedSizeListArray;
use vortex_array::arrays::ListArray;
use vortex_array::arrays::ListViewArray;
Expand All @@ -26,11 +27,12 @@ use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

/// A shared session for the `ListView` rebuild benchmarks, used to create execution contexts.
static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

fn make_primitive_lv(num_lists: usize, list_size: usize, step: usize) -> ListViewArray {
let element_count = step * num_lists + list_size;
Expand Down
13 changes: 7 additions & 6 deletions vortex-array/benches/primitive_zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,20 +10,24 @@
use std::sync::LazyLock;

use divan::Bencher;
use vortex_array::ArrayRef;
use vortex_array::IntoArray;
use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::validity::Validity;
use vortex_buffer::BufferMut;
use vortex_mask::Mask;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

// Sized so the bench stays well under a few hundred microseconds under CodSpeed's instruction-count
// simulation, which runs ~10x the local walltime; the branchless value blend is still exercised.
Expand All @@ -49,7 +53,7 @@ fn nullable(bencher: Bencher) {
run(bencher, if_true, if_false);
}

fn run(bencher: Bencher, if_true: vortex_array::ArrayRef, if_false: vortex_array::ArrayRef) {
fn run(bencher: Bencher, if_true: ArrayRef, if_false: ArrayRef) {
let mask = mask();
bencher
.with_inputs(|| {
Expand All @@ -71,10 +75,7 @@ fn run(bencher: Bencher, if_true: vortex_array::ArrayRef, if_false: vortex_array
fn nonnull_array(base: i64) -> PrimitiveArray {
let mut values = BufferMut::<i64>::with_capacity(LEN);
values.extend((0..LEN as i64).map(|i| base + i));
PrimitiveArray::new(
values.freeze(),
vortex_array::validity::Validity::NonNullable,
)
PrimitiveArray::new(values.freeze(), Validity::NonNullable)
}

fn nullable_array(base: i64, null_every: usize) -> PrimitiveArray {
Expand Down
4 changes: 3 additions & 1 deletion vortex-array/benches/scalar_at_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,22 @@ use rand::rngs::StdRng;
use vortex_array::ArrayRef;
use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::StructArray;
use vortex_array::dtype::FieldNames;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

const ARRAY_SIZE: usize = 100_000;
const NUM_ACCESSES: usize = 1000;

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench]
fn execute_scalar_struct_simple(bencher: Bencher) {
Expand Down
11 changes: 5 additions & 6 deletions vortex-array/benches/scalar_subtract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,21 @@ use rand::rngs::StdRng;
use vortex_array::IntoArray;
use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::array_session;
use vortex_array::arrays::ChunkedArray;
use vortex_array::arrays::ConstantArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::scalar::Scalar;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
LazyLock::force(&SESSION);
divan::main();
}

static SESSION: LazyLock<VortexSession> = LazyLock::new(vortex_array::array_session);
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);

#[divan::bench]
fn scalar_subtract(bencher: Bencher) {
Expand All @@ -50,11 +53,7 @@ fn scalar_subtract(bencher: Bencher) {
chunked
.clone()
.binary(
ConstantArray::new(
vortex_array::scalar::Scalar::from(to_subtract),
chunked.len(),
)
.into_array(),
ConstantArray::new(Scalar::from(to_subtract), chunked.len()).into_array(),
Operator::Sub,
)
.unwrap()
Expand Down
Loading
Loading