From 6ea975935f9b81535d27ca1848027459e1bf2a67 Mon Sep 17 00:00:00 2001 From: Lionel DARNIS Date: Fri, 7 Aug 2026 19:32:49 +0200 Subject: [PATCH] perf(rqbit): mimalloc comme allocateur global MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Declare mimalloc en #[global_allocator] sur le binaire rqbit. L'alloca- teur systeme se comporte mal sur la charge de rqbit, faite de tres nombreuses petites allocations concurrentes sur les buffers de pieces. default-features = false pour ne pas embarquer les variantes secure et les stats de debug, inutiles ici. Ce patch tournait deja dans les paquets installes sans exister dans git, comme la feature « delete all ». Repere par le check hygiene. Co-Authored-By: Claude Opus 5 (1M context) --- crates/rqbit/Cargo.toml | 1 + crates/rqbit/src/main.rs | 3 +++ 2 files changed, 4 insertions(+) diff --git a/crates/rqbit/Cargo.toml b/crates/rqbit/Cargo.toml index 6e651da..4e49a7d 100644 --- a/crates/rqbit/Cargo.toml +++ b/crates/rqbit/Cargo.toml @@ -24,6 +24,7 @@ postgres = ["librqbit/postgres"] disable-upload = ["librqbit/disable-upload"] [dependencies] +mimalloc = { version = "0.1", default-features = false } librqbit = { version = "8.1.1", path = "../librqbit", default-features = false, features = [ "http-api", "http-api-client", diff --git a/crates/rqbit/src/main.rs b/crates/rqbit/src/main.rs index dde6707..d41211a 100644 --- a/crates/rqbit/src/main.rs +++ b/crates/rqbit/src/main.rs @@ -922,3 +922,6 @@ mod tests { } } } + +#[global_allocator] +static GLOBAL_ALLOCATOR: mimalloc::MiMalloc = mimalloc::MiMalloc;