Skip to content

Commit 4c40890

Browse files
authored
Use mimalloc for expression benchmarks (#9523)
Configure mimalloc as the global allocator for every vortex-array expression benchmark, aligning setup with other benchmark targets. Signed-off-by: Matt Katz <[email protected]>
1 parent 9876921 commit 4c40890

4 files changed

Lines changed: 16 additions & 0 deletions

File tree

‎vortex-array/benches/expr/case_when_bench.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use std::sync::LazyLock;
88

99
use divan::Bencher;
10+
use mimalloc::MiMalloc;
1011
use vortex_array::ArrayRef;
1112
use vortex_array::Canonical;
1213
use vortex_array::IntoArray;
@@ -26,6 +27,9 @@ use vortex_array::expr::root;
2627
use vortex_buffer::Buffer;
2728
use vortex_session::VortexSession;
2829

30+
#[global_allocator]
31+
static GLOBAL: MiMalloc = MiMalloc;
32+
2933
static SESSION: LazyLock<VortexSession> = LazyLock::new(array_session);
3034

3135
fn main() {

‎vortex-array/benches/expr/large_struct_pack.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![expect(clippy::unwrap_used)]
55

66
use divan::Bencher;
7+
use mimalloc::MiMalloc;
78
use vortex_array::dtype::DType;
89
use vortex_array::dtype::FieldName;
910
use vortex_array::dtype::Nullability;
@@ -13,6 +14,9 @@ use vortex_array::expr::get_item;
1314
use vortex_array::expr::pack;
1415
use vortex_array::expr::root;
1516

17+
#[global_allocator]
18+
static GLOBAL: MiMalloc = MiMalloc;
19+
1620
fn main() {
1721
divan::main();
1822
}

‎vortex-array/benches/expr/optimize_bench.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#![expect(clippy::cast_possible_truncation)]
66

77
use divan::Bencher;
8+
use mimalloc::MiMalloc;
89
use vortex_array::dtype::DType;
910
use vortex_array::dtype::Nullability;
1011
use vortex_array::dtype::PType;
@@ -16,6 +17,9 @@ use vortex_array::expr::lit;
1617
use vortex_array::expr::or;
1718
use vortex_array::expr::root;
1819

20+
#[global_allocator]
21+
static GLOBAL: MiMalloc = MiMalloc;
22+
1923
fn main() {
2024
divan::main();
2125
}

‎vortex-array/benches/expr/optimize_predicate.rs‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ use std::sync::Arc;
1414

1515
use divan::Bencher;
1616
use divan::black_box;
17+
use mimalloc::MiMalloc;
1718
use vortex_array::dtype::DType;
1819
use vortex_array::dtype::Nullability;
1920
use vortex_array::dtype::PType;
@@ -33,6 +34,9 @@ use vortex_array::extension::datetime::TimeUnit;
3334
use vortex_array::extension::datetime::Timestamp;
3435
use vortex_array::scalar::Scalar;
3536

37+
#[global_allocator]
38+
static GLOBAL: MiMalloc = MiMalloc;
39+
3640
fn main() {
3741
divan::main();
3842
}

0 commit comments

Comments
 (0)