5 comments

[ 3.0 ms ] story [ 28.5 ms ] thread
It's curious that Rust performed as node did. I thought surely it would be better
According to the reddit thread, the benchmarks were done on a pretty beefy MBP.

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.