Link time optimization in D

Walter Bright newshound1 at digitalmars.com
Tue Jun 1 11:45:47 PDT 2010


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.
> 
>> More importantly, what if you only have access to the object files?
> 
> Unless you make those object files with the special -lto switch, you
> still don't get the benefit.

Right. I wish to add that when compiling with full optimization on, the 
optimization time dominates the compile time. You'd only do LTO when doing a 
release build with full optimization, so it essentially is compiling the full 
program even when doing an incremental build.


More information about the Digitalmars-d mailing list