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
2 changes: 2 additions & 0 deletions vortex-array/benches/aggregate_grouped.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@ use vortex_array::arrays::ListViewArray;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::arrays::VarBinViewArray;
use vortex_array::dtype::DType;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;

fn main() {
LEGACY_SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/aggregate_max.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ use vortex_array::IntoArray;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/aggregate_sum.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,11 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::expr::stats::Stat;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/binary_ops.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,11 @@ use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/bool_zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::BoolArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_mask::Mask;

fn main() {
LEGACY_SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/cast_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,11 @@ use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::expr::stats::Stat;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/chunk_array_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,12 @@ use vortex_array::builders::VarBinViewBuilder;
use vortex_array::builders::builder_with_capacity;
use vortex_array::dtype::DType;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_error::VortexExpect;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/chunked_dict_builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,12 @@ use vortex_array::arrays::dict_test::gen_dict_primitive_chunks;
use vortex_array::builders::builder_with_capacity;
use vortex_array::dtype::NativePType;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_error::VortexExpect;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/chunked_fsl_canonicalize.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,13 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::ChunkedArray;
use vortex_array::arrays::FixedSizeListArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/dict_compare.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,11 @@ use vortex_array::expr::lit;
use vortex_array::expr::root;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/dict_compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,11 @@ use vortex_array::arrays::dict_test::gen_varbin_words;
use vortex_array::builders::dict::dict_encode;
use vortex_array::dtype::NativePType;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/expr/case_when_bench.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,15 @@ use vortex_array::expr::lt;
use vortex_array::expr::nested_case_when;
use vortex_array::expr::root;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/filter_bool.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,13 @@ use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::BoolArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_buffer::BitBuffer;
use vortex_mask::Mask;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/listview_rebuild.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ use vortex_array::arrays::listview::ListViewArrayExt;
use vortex_array::arrays::listview::ListViewRebuildMode;
use vortex_array::dtype::FieldNames;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/primitive_zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_buffer::BufferMut;
use vortex_mask::Mask;

fn main() {
LEGACY_SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/scalar_at_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::StructArray;
use vortex_array::dtype::FieldNames;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/scalar_subtract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,12 @@ use vortex_array::arrays::ConstantArray;
use vortex_array::builtins::ArrayBuiltins;
use vortex_array::scalar_fn::fns::operators::Operator;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/take_filter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::ListArray;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::BitBuffer;
use vortex_buffer::BitBufferMut;
Expand All @@ -39,6 +40,7 @@ use vortex_mask::Mask;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/take_fsl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,13 @@ use vortex_array::RecursiveCanonical;
use vortex_array::VortexSessionExecute;
use vortex_array::arrays::FixedSizeListArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/take_patches.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,12 @@ use vortex_array::ToCanonical as _;
use vortex_array::VortexSessionExecute;
use vortex_array::patches::Patches;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/take_primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::DictArray;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/take_struct.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,13 @@ use vortex_array::VortexSessionExecute;
use vortex_array::arrays::StructArray;
use vortex_array::dtype::FieldNames;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::Buffer;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/to_arrow.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ use vortex_array::dtype::Nullability;
use vortex_array::dtype::PType;
use vortex_array::dtype::StructFields;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
2 changes: 2 additions & 0 deletions vortex-array/benches/varbinview_zip.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,12 @@ use vortex_array::builtins::ArrayBuiltins;
use vortex_array::dtype::DType;
use vortex_array::dtype::Nullability;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_mask::Mask;
use vortex_session::VortexSession;

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
17 changes: 17 additions & 0 deletions vortex-array/src/test_harness.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,28 @@ use goldenfile::Mint;
use goldenfile::differs::binary_diff;
use itertools::Itertools;
use vortex_error::VortexResult;
use vortex_session::SessionExt;

use crate::LEGACY_SESSION;
use crate::VortexSessionExecute;
use crate::arrays::BoolArray;
use crate::arrays::bool::BoolArrayExt;
use crate::optimizer::kernels::ArrayKernels;

/// Extension trait for warming session variables before a benchmark's measured region.
///
/// The first access to a session variable inserts its default value. Performing that one-time
/// insertion inside a benchmark's measured loop charges it to the first measured iteration, which
/// is a problem under CodSpeed's instruction-count simulation. Calling [`Self::warm_kernels`]
/// before the bench loop moves the [`ArrayKernels`] insertion into setup instead.
pub trait WarmKernelsExt: SessionExt {
/// Eagerly initialize the optimizer [`ArrayKernels`] on this session.
fn warm_kernels(&self) {
drop(self.get::<ArrayKernels>());
}
}

impl<S: SessionExt> WarmKernelsExt for S {}

/// Check that a named metadata matches its previous versioning.
///
Expand Down
2 changes: 2 additions & 0 deletions vortex-compressor/benches/dict_encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ use vortex_array::arrays::BoolArray;
use vortex_array::arrays::PrimitiveArray;
use vortex_array::builders::dict::dict_encode;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_array::validity::Validity;
use vortex_buffer::BufferMut;
use vortex_compressor::builtins::integer_dictionary_encode;
Expand Down Expand Up @@ -55,5 +56,6 @@ fn encode_specialized(bencher: Bencher) {
}

fn main() {
SESSION.warm_kernels();
divan::main()
}
2 changes: 2 additions & 0 deletions vortex-row/benches/row_encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use vortex_array::arrays::PrimitiveArray;
use vortex_array::arrays::StructArray;
use vortex_array::arrays::VarBinViewArray;
use vortex_array::session::ArraySession;
use vortex_array::test_harness::WarmKernelsExt;
use vortex_row::RowEncoder;
use vortex_session::VortexSession;

Expand All @@ -46,6 +47,7 @@ static SESSION: LazyLock<VortexSession> =
LazyLock::new(|| VortexSession::empty().with::<ArraySession>());

fn main() {
SESSION.warm_kernels();
divan::main();
}

Expand Down
3 changes: 3 additions & 0 deletions vortex/benches/common_encoding_tree_throughput.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ use vortex::array::arrays::VarBinArray;
use vortex::array::arrays::VarBinViewArray;
use vortex::array::arrays::varbin::VarBinArrayExt;
use vortex::array::builtins::ArrayBuiltins;
use vortex::array::optimizer::kernels::ArrayKernels;
use vortex::array::session::ArraySession;
use vortex::dtype::DType;
use vortex::dtype::PType;
Expand All @@ -44,12 +45,14 @@ use vortex::encodings::runend::RunEnd;
use vortex::encodings::runend::RunEndArrayExt;
use vortex::error::VortexExpect;
use vortex::extension::datetime::TimeUnit;
use vortex_session::SessionExt;
use vortex_session::VortexSession;

#[global_allocator]
static GLOBAL: MiMalloc = MiMalloc;

fn main() {
drop(SESSION.get::<ArrayKernels>());
divan::main();
}

Expand Down
Loading