Swap Tokio's default allocator for jemalloc: median serde latency halved, p99 down ~40%
DanielLockyer · x · 2026-12-06
rustaceansrs highlights an overlooked Rust engineering practice: services built on Tokio should override the default memory allocator.
Under Tokio's work-stealing scheduler, cross-thread frees frequently cause allocator contention, a hidden performance bottleneck. The fix is switching the global allocator to jemalloc, with measured results:
- median serde latency halved
- p99 latency cut by 40%
A one-line-config-level change with a major impact on tail latency — worth checking for any team running Tokio in production.
More from Infra
- Sacks: 600,000 H200s stranded at Hong Kong dock as US hits consensus on zero chips to China — kevinnbass · 2026-12-06
- DeepSeek squeezes 1.85x inference gains on Huawei Ascend, validating Jensen Huang's export-control warning — Dan_Jeffries1 · 2026-12-06
- Qwen4-35B-A3B hits 105.7 tok/s on M5 Pro via Kapitsa, MLX and GGUF quants released — 0zyman23 · 2026-12-06
- SQLite over everything: devs say Postgres's setup friction is why MongoDB took off — abhi9u · 2026-12-06
- Google donates Agent Substrate to CNCF: a Kubernetes runtime for hosting AI agents — Prompt Engineering · 2026-12-06
- Running 66GB Models Full BF16/FP8 on a Single RTX 5070 With 12GB VRAM — InterestingAd5595 · 2026-12-06