Skip to content

Commit 5ee7e58

Browse files
committed
test(runner-shared): run the memtrack benches on mimalloc
1 parent 2c7670b commit 5ee7e58

4 files changed

Lines changed: 7 additions & 1 deletion

File tree

‎Cargo.lock‎

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/runner-shared/Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ zstd = "0.13.3"
2828
[dev-dependencies]
2929
divan = { version = "4.2.0", package = "codspeed-divan-compat" }
3030
memmap2 = "0.9.10"
31+
mimalloc = { workspace = true }
3132
rand = "0.8"
3233
tempfile = { workspace = true }
3334

‎crates/runner-shared/benches/memtrack_reader.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ use runner_shared::measurement_mode::MeasurementMode;
1515
use runner_shared::runtime_env::RUNNER_MODE_ENV;
1616
use std::io::Write;
1717

18+
#[global_allocator]
19+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
20+
1821
fn main() {
1922
divan::main();
2023
}

‎crates/runner-shared/benches/memtrack_writer.rs‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ use runner_shared::artifacts::{
1616
/// there anyway.
1717
#[cfg(not(codspeed))]
1818
#[global_allocator]
19-
static ALLOC: divan::AllocProfiler = divan::AllocProfiler::system();
19+
static ALLOC: divan::AllocProfiler<mimalloc::MiMalloc> =
20+
divan::AllocProfiler::new(mimalloc::MiMalloc);
2021

2122
fn main() {
2223
divan::main();

0 commit comments

Comments
 (0)