Link time optimization in D

Don nospam at nospam.com
Tue Jun 1 11:15:05 PDT 2010


Michiel Helvensteijn wrote:
> Adam Ruppe wrote:
> 
>>> You save time by recompiling only files that have changes.
>> But, then the whole program goes through the process again anyway to
>> perform the optimization. You save a little time in skipping parts of
>> the front end for unchanged file, but the whole backend process has to
>> happen anyway.
> 
> That `backend' process is not the compilation process all over again. It's
> not even the optimizer phase all over again. It's just the extra
> optimizations that could not be performed on a file-by-file basis.
> 
> Or at least it should be.

It really needs to be able to perform inlining, and that means it's 
still a fair chunk of the optimiser. It's true that link-time 
optimisation means that much of the front-end compilation can be 
skipped, which is a huge fraction of the total time in C++. (Certainly 
you can skip the parsing step completely). But it's a much smaller 
fraction of the total time in D. So it isn't the big win for D that it 
is for C++.



More information about the Digitalmars-d mailing list