How to speed up the Rust compiler
&gt; <i>malloc and free are still the two hottest functions in most benchmarks. Avoiding heap allocations can be a win.</i><p>This is a non-sequitur. If you see a hot function in a profile, that is an indication that you should optimize that function if you can. But it does not mean that you should try to reduce calls to that function elsewhere (unless you can cut out a lot in one go). As a trivial example, if you have a super-fast function that cannot be optimized any further, but it&#x27;s called millions of times, that function may appear hot, but any individual invocation of the function might be taking just a few microseconds. Getting rid of a handful of calls to this function (or even a few hundred) isn&#x27;t going to make an appreciable difference. Of course, if you can cut the number of calls in half, then that would be good.<p>I guess another way of saying this is, if you&#x27;re trying to optimize a hot function by reducing the number of times it&#x27;s called, you need to reduce it by a significant percentage of the total calls rather than reducing it by a specific number of times. No matter how many times it&#x27;s called, if you reduce the number of calls by 50%, the overall time taken by the function drops by 50%. But if you reduce the number of calls by 50, then whether that&#x27;s meaningful or not depends entirely on how long each individual call to the function takes.<p>Edit: Why am I being downvoted for this? I&#x27;m speaking a factually correct statement. It&#x27;s not like this is some sort of controversial opinion. If I&#x27;m wrong, please tell me why.