diff --git a/crates/re_arrow_store/Cargo.toml b/crates/re_arrow_store/Cargo.toml index a1bef5e6c886..af9a149db7e9 100644 --- a/crates/re_arrow_store/Cargo.toml +++ b/crates/re_arrow_store/Cargo.toml @@ -25,6 +25,11 @@ deadlock_detection = ["parking_lot/deadlock_detection"] ## Integration with `polars`, to efficiently use the datastore with dataframes. polars = ["dep:polars-core", "dep:polars-ops"] +## When set, disables costly benchmark suites that measure the performance of third-party +## libraries. +## Commonly set implicitly by --all-features, e.g. on CI. +dont_bench_third_party = [] + [dependencies] # Rerun dependencies: diff --git a/crates/re_arrow_store/benches/arrow2.rs b/crates/re_arrow_store/benches/arrow2.rs index 9021b26e2dde..af02ac5289a6 100644 --- a/crates/re_arrow_store/benches/arrow2.rs +++ b/crates/re_arrow_store/benches/arrow2.rs @@ -9,7 +9,7 @@ use arrow2::{ array::{Array, PrimitiveArray, StructArray, UnionArray}, compute::aggregate::estimated_bytes_size, }; -use criterion::{criterion_group, criterion_main, Criterion}; +use criterion::{criterion_group, Criterion}; use itertools::Itertools; use re_log_types::{ component_types::{InstanceKey, Point2D, Rect2D}, @@ -21,7 +21,13 @@ use re_log_types::{ // --- criterion_group!(benches, erased_clone, estimated_size_bytes); -criterion_main!(benches); + +#[cfg(not(feature = "dont_bench_third_party"))] +criterion::criterion_main!(benches); + +// Don't run these benchmarks on CI: they measure the performance of third-party libraries. +#[cfg(feature = "dont_bench_third_party")] +fn main() {} // --- diff --git a/crates/re_arrow_store/benches/arrow2_convert.rs b/crates/re_arrow_store/benches/arrow2_convert.rs index c53dd6b5bd80..92a070e49f28 100644 --- a/crates/re_arrow_store/benches/arrow2_convert.rs +++ b/crates/re_arrow_store/benches/arrow2_convert.rs @@ -4,7 +4,7 @@ static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; use arrow2::{array::PrimitiveArray, datatypes::PhysicalType, types::PrimitiveType}; -use criterion::{criterion_group, criterion_main, Criterion}; +use criterion::{criterion_group, Criterion}; use re_log_types::{ component_types::InstanceKey, external::arrow2_convert::deserialize::TryIntoCollection, Component as _, DataCell, @@ -13,7 +13,13 @@ use re_log_types::{ // --- criterion_group!(benches, serialize, deserialize); -criterion_main!(benches); + +#[cfg(not(feature = "dont_bench_third_party"))] +criterion::criterion_main!(benches); + +// Don't run these benchmarks on CI: they measure the performance of third-party libraries. +#[cfg(feature = "dont_bench_third_party")] +fn main() {} // --- diff --git a/crates/re_arrow_store/benches/vectors.rs b/crates/re_arrow_store/benches/vectors.rs index c61b4667fa92..0ddd3b316e31 100644 --- a/crates/re_arrow_store/benches/vectors.rs +++ b/crates/re_arrow_store/benches/vectors.rs @@ -3,13 +3,21 @@ #[global_allocator] static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; -use criterion::{criterion_group, criterion_main, Criterion}; +use criterion::{criterion_group, Criterion}; use smallvec::SmallVec; use tinyvec::TinyVec; +// --- + criterion_group!(benches, sort, split, swap, swap_opt); -criterion_main!(benches); + +#[cfg(not(feature = "dont_bench_third_party"))] +criterion::criterion_main!(benches); + +// Don't run these benchmarks on CI: they measure the performance of third-party libraries. +#[cfg(feature = "dont_bench_third_party")] +fn main() {} // ---