Benchmarking GPRC in Rust and Go
medium.com
medium.com
The macOS malloc is known to perform poorly, so I wonder if it's possible to narrow the gap just by using jemalloc, without any other optimisations.
// Cargo.toml
[dependencies]
...
jemallocator = "0.3"
// main.rs
use jemallocator::Jemalloc;
#[global_allocator]
static GLOBAL: Jemalloc = Jemalloc;
If the issue is indeed repeated (de-)allocations, I would also like to see Linux glibc/musl benchmarks. I expect musl malloc to perform even worse, so many stories about allocation sensitive services performing horribly in production because they're based on alpine images.