How to speed up the Rust compiler
As far as I know, the Rust compiler is written in Rust? That should mean that if the features of the language are used, a lot of &quot;small&quot; allocations shouldn&#x27;t happen at all, instead, the language is supposed to allow that the short lived variables (and objects) exist only on the stack, costing effectively nothing to allocate them?<p>Moreover, the compilers in general have an advantage to know that most of the objects are needed only during specific times, allowing optimized allocation and bundled deallocation. I see &quot;a lot&quot; of &quot;arena&quot; allocators are mentioned, so it seems there is something like that, just maybe too fine grained?<p>In short, there&#x27;s no need for the Rust compiler to have any measurable overhead due to the allocations.<p>Then only the changes in the compiling algorithms and the underlying data structures (how often is what traversed and why, is something kept or recalculated, sometimes it&#x27;s even more expensive to produce too much data to be kept in memory, and sometimes the data structures aren&#x27;t optimal for the most of the uses) should have the potential of changing the compilation speed.