malloc is a universal distributor - "not slow" is more important than "always fast".
Consider a feature that will be a 10% improvement in many common cases, but can lead to a significant decrease in performance in a few rare cases. An application distribution specialist can avoid the rare occasion and take advantage. A general purpose dispenser should not.
In addition to the number of calls in malloc, there are other relevant attributes:
distribution localization
On current hardware, this is easily the most important performance factor. The application has more knowledge of access patterns and can optimize distributions accordingly.
multithreading
A general-purpose distributor must allow malloc calls and exempt from different threads. This usually requires blocking or similar concurrency processing. If the bunch is very busy, this leads to massive debate.
An application that knows that some high-frequency alloc / frees come from only one stream can use its own stream-dependent heap, which not only avoids conflicts for these distributions, but also increases their locality and unloads the default distributor.
fragmentation
This is still a problem for long-term applications on systems with limited physical memory or address space. Fragmentation may require more and more memory or address space from the OS, even without increasing the actual working set. This is a serious problem for applications that need to run smoothly.
The last time I looked deeper into the distributors (which probably half a century ago), the consensus was that naive attempts to reduce fragmentation often contradict the never-delayed rule.
Again, an application that knows (some of it) distribution patterns can take a heavy load from the default allocator. One of the most common use cases is to build a syntax tree or something similar: there are small distribution gazilles that are never individually released, only as a whole. Such a template can be efficiently served using a very trivial dispenser.
fault tolerance and diagnostics
Last but not least, the default diagnostic and self-protection capabilities of the dispenser may not be sufficient for many applications.
peterchen
source share