On the performance of building D programs

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Sun Apr 7 05:10:27 PDT 2013


On 4/7/13 7:45 AM, Andrej Mitrovic wrote:
> Hmm.. ok so we have to add an incremental option to RDMD. If I'm not
> mistaken the build process for the following project would look like:
>
> main.d ->  foo.d ->  bar.d ->  doo.d
>
> 1. Invoke DMD to build recursively, and simultaneously fetch the
> dependencies to RDMD which will store the dependencies to a file:
>
> $ dmd -rb main.d -v
>
> 2. On the second build (let's assume foo.d changed), RDMD would read
> the dependencies, check the modification time of each file, and
> knowing only foo.d has to be rebuilt it would run DMD again with:
>
> $ dmd -rb main.d -rxbar bar.obj -rxdoo doo.obj
>
> This assumes it keeps the object files on disk and doesn't delete them.
>
> Would this work?

Yah. One question would be how to store dependencies. One possibility is 
to flatly store transitive dependencies for each file (rdmd currently 
does that, but only for the main file). This would take care of circular 
dependencies automatically. One other option is to store only direct 
dependencies for each file, and then use a graph walker to get work done.

(I seem to recall Go is that it has a simple highly linearized 
organization of dependencies. If anyone knows more about that, please 
share.)


Andrei


More information about the Digitalmars-d mailing list