Study: build times for D programs

Rainer Schuetze r.sagitario at
Wed Jul 25 23:36:50 PDT 2012

On 26.07.2012 03:48, Walter Bright wrote:
> On 7/25/2012 1:53 PM, Rainer Schuetze wrote:
>> The "edit-compile-debug loop" is a use case where the D module system
>> does not
>> shine so well. Compare build times when only editing a single source
>> file:
>> With the help of incremental linking, building a large C++ project
>> only takes
>> seconds.
>> In contrast, the D project usually recompiles everything from scratch
>> with every
>> little change.
> I suspect that's one of two possibilities:
> 1. everything is passed on one command line to dmd. This, of course,
> requires dmd to recompile everything.
> 2. modules are not separated into .d and .di files. Hence every module
> that imports a .d file has to, at least, parse and semantically analyze
> the whole thing, although it won't optimize or generate code for it.

I think working with di-files is too painful. A lot of the analysis in 
imported files could be skipped.

> As for incremental linking, optlink has always been faster at doing a
> full link than the Microsoft linker does for an incremental link.

Agreed, incremental linking is just a work-around for the linkers slowness.

More information about the Digitalmars-d mailing list