If you use Tokio, you should override the default allocator
Comments
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Ranked by a public rubric, not by votes: what a comment adds counts, not who wrote it. How comments are ranked · Comment rules
Summary
Matthew Pope, writing on the dial9 blog, describes a multi-threaded Rust service on Tokio whose Ion serialization ran far slower in production than in local benchmarks. Profiles showed most samples in allocation and drop calls, and a synthetic test found glibc about 2.5× slower than jemalloc or mimalloc when values were freed on a different thread. Switching to jemalloc cut serde latency by over half at the median and about 40% at p99. The author notes his measurements are approximate and that other fixes were also needed.