diff --git a/Cargo.lock b/Cargo.lock index 102516ce..43440ea8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -729,6 +729,7 @@ dependencies = [ "md5", "memmap2", "memtrack", + "mimalloc", "nestify", "nix 0.31.3", "object", diff --git a/Cargo.toml b/Cargo.toml index 4cc37af8..8bcc2ba8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,6 +60,7 @@ linux-perf-data = { git = "https://github.com/mstange/linux-perf-data.git", rev ] } # unreleased main as of 2026-03-19 debugid = "0.8.0" memmap2 = "0.9.10" +mimalloc = "0.1" nix = { version = "0.31.3", features = ["fs", "time", "user"] } futures = "0.3.32" runner-shared = { path = "crates/runner-shared" } diff --git a/src/main.rs b/src/main.rs index 518b8d3e..678ac3ca 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,9 @@ +// The release binary targets musl, whose allocator is slow on small +// allocations and serializes threads. Decoding memtrack artifacts allocates per +// event, which made post-processing take minutes on large artifacts. +#[global_allocator] +static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc; + use codspeed_runner::{clean_logger, cli}; use console::style; use log::log_enabled;