Skip to content

Commit becef76

Browse files
moha-bekhclaude
andauthored
perf(runner): use mimalloc as the global allocator
memtrack runs as a subcommand of this binary, so the allocator set in its own `main.rs` no longer applies to it. Set mimalloc on the runner binary instead, which covers memtrack and the rest of the runner alike. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 parent 7f2f2a5 commit becef76

3 files changed

Lines changed: 5 additions & 0 deletions

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.

‎Cargo.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ uuid = { version = "1.23.1", features = ["v4"] }
7777
which = "8.0.2"
7878
crc32fast = "1.5.0"
7979
samply = { path = "crates/samply-codspeed/samply" }
80+
mimalloc = "0.1"
8081

8182
# Memory profiling (memtrack) and the capability handling around it are Linux-only.
8283
[target.'cfg(target_os = "linux")'.dependencies]

‎src/main.rs‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
#[global_allocator]
2+
static GLOBAL: mimalloc::MiMalloc = mimalloc::MiMalloc;
3+
14
use codspeed_runner::{clean_logger, cli};
25
use console::style;
36
use log::log_enabled;

0 commit comments

Comments
 (0)