From 928110981727793068c0f907647baaba095bc9cc Mon Sep 17 00:00:00 2001 From: Alexis ROBIN Date: Sun, 4 Jan 2026 23:47:19 +0100 Subject: [PATCH] feat(perf): switch to tikv-jemallocator --- Cargo.lock | 1 + architectures/centralized/server/Cargo.toml | 3 +++ architectures/centralized/server/src/main.rs | 6 +++++- 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 7553c18b5..f07061009 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6888,6 +6888,7 @@ dependencies = [ "rand 0.9.2", "serde", "sha2 0.10.9", + "tikv-jemallocator", "tokio", "tokio-stream", "tokio-util 0.7.16", diff --git a/architectures/centralized/server/Cargo.toml b/architectures/centralized/server/Cargo.toml index 4ce5c9d59..c761c8108 100644 --- a/architectures/centralized/server/Cargo.toml +++ b/architectures/centralized/server/Cargo.toml @@ -32,5 +32,8 @@ toml.workspace = true clap-markdown.workspace = true psyche-python-extension-impl = { workspace = true, optional = true } +[target.'cfg(target_family = "unix")'.dependencies] +tikv-jemallocator = "0.6" + [features] python = ["psyche-python-extension-impl"] diff --git a/architectures/centralized/server/src/main.rs b/architectures/centralized/server/src/main.rs index 58cf2cf00..97d8687d3 100644 --- a/architectures/centralized/server/src/main.rs +++ b/architectures/centralized/server/src/main.rs @@ -7,8 +7,8 @@ use clap::{ArgAction, Parser}; use psyche_centralized_shared::ClientId; use psyche_coordinator::Coordinator; use psyche_tui::{ - LogOutput, ServiceInfo, logging::{MetricsDestination, OpenTelemetry, RemoteLogsDestination, TraceDestination}, + LogOutput, ServiceInfo, }; use std::{ path::{Path, PathBuf}, @@ -16,6 +16,10 @@ use std::{ }; use tracing::{error, info}; +#[cfg(target_family = "unix")] +#[global_allocator] +static GLOBAL: tikv_jemallocator::Jemalloc = tikv_jemallocator::Jemalloc; + #[derive(Parser, Debug)] struct Args { #[command(subcommand)]