From f648f17ec3dd9b99d6271f607d62004c321b7c8f Mon Sep 17 00:00:00 2001 From: Ilan Joselevich Date: Thu, 8 Aug 2024 00:21:26 +0300 Subject: feat(tvix): Jemalloc -> MiMalloc Use the faster and newer MiMalloc memory allocator for all endpoints in the workspace. Change-Id: Ic60237284ed168e46ec6e8f28e2710bae4385c6f Reviewed-on: https://cl.tvl.fyi/c/depot/+/12149 Tested-by: BuildkiteCI Reviewed-by: aspen --- tvix/nar-bridge/Cargo.toml | 1 + tvix/nar-bridge/src/bin/nar-bridge.rs | 4 ++++ 2 files changed, 5 insertions(+) (limited to 'tvix/nar-bridge') diff --git a/tvix/nar-bridge/Cargo.toml b/tvix/nar-bridge/Cargo.toml index c2a03d981793..ba5f21ee6021 100644 --- a/tvix/nar-bridge/Cargo.toml +++ b/tvix/nar-bridge/Cargo.toml @@ -28,6 +28,7 @@ url = "2.4.0" serde = { version = "1.0.204", features = ["derive"] } lru = "0.12.3" parking_lot = "0.12.3" +mimalloc = "0.1.43" [build-dependencies] prost-build = "0.13.1" diff --git a/tvix/nar-bridge/src/bin/nar-bridge.rs b/tvix/nar-bridge/src/bin/nar-bridge.rs index cf312649d147..48eba0ac44ac 100644 --- a/tvix/nar-bridge/src/bin/nar-bridge.rs +++ b/tvix/nar-bridge/src/bin/nar-bridge.rs @@ -1,10 +1,14 @@ use clap::Parser; +use mimalloc::MiMalloc; use nar_bridge::AppState; use tower::ServiceBuilder; use tower_http::trace::{DefaultMakeSpan, TraceLayer}; use tracing::info; use tvix_store::utils::ServiceUrlsGrpc; +#[global_allocator] +static GLOBAL: MiMalloc = MiMalloc; + /// Expose the Nix HTTP Binary Cache protocol for a tvix-store. #[derive(Parser)] #[command(author, version, about, long_about = None)] -- cgit 1.4.1