Battle of the Mallocators
smalldatum.blogspot.com
smalldatum.blogspot.com
To be blunt: my gut would say that glibc on typical distros is more hardened than default builds of alternative heap implementations, and if it's only off by a few percent it might well be the faster code if measured apples-to-apples.
I lurk on email lists for RocksDB and OOM from glibc malloc is a problem for users -- the solution is easy, use jemalloc or tcmalloc.
Fun fact, jemalloc was the default allocator for rust but was dropped off and use default system allocator to have smaller binary size
Nowadays, there are at least two different versions of tcmalloc: the one from https://github.com/google/tcmalloc/ is newer (it has rseq support, for example), and the version bundled in https://github.com/gperftools/gperftools.
I use the latest LTS release of Ubuntu, which is Ubuntu 22.04, and the library versions are what Ubuntu provides. So these are the libraries that most of us use when using Ubuntu LTS. Regardless, I am happy that tcmalloc and jemalloc continue to improve.
Occasionally I get "your version of X is too old" when I publish results for X, and I have had mixed results in the past when doing even more work to test the newer thing. In this case I am not going to put in that extra time. But in a few years I might revisit the topic and get newer versions of X, of course, there will be feedback that the version of X I test in 2028 is from 2026 and the story repeats.
It took a few weeks to figure that out for several of my servers. So I am slow to upgrade things once that gets stable -- and it has been stable for my servers for about 6 months.
[1] https://www.kernel.org/doc/html/latest/filesystems/proc.html