Garbage collector, C malloc and performance

I am not sure that this question can be phrased in such a general way. How a C program uses malloc is crucial. In any case, modern GC implementations for nontrivial programs (that actually need to allocate) are quite hard to beat with manual memory management.

Whenever that is possible. Sometimes it isn’t, or not without a lot of complications that are just not worth it.