On the performance of building D programs

Andrej Mitrovic andrej.mitrovich at gmail.com
Sun Apr 7 04:45:23 PDT 2013


On 4/7/13, Andrei Alexandrescu <SeeWebsiteForEmail at erdani.org> wrote:
> Do you plan to convert your work into a pull request?

Sure.

On 4/7/13, Vladimir Panteleev <vladimir at thecybershadow.net> wrote:
> By "incremental builds", do you mean skipping compilation of
> certain modules, and re-using object files from previous builds?

Yeah.

On 4/7/13, Vladimir Panteleev <vladimir at thecybershadow.net> wrote:
> Why not adapt rdmd so that it takes advantage of the new script?

Yeah, RDMD could take advantage of -rx to avoid building specific
modules. It slipped my mind.

> Currently, rdmd deletes all generated modules after building, to
> save disk space, as those modules are not reused in subsequent
> builds.

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?

On 4/7/13, Vladimir Panteleev <vladimir at thecybershadow.net> wrote:
> As I understand, there were some problems with how dmd places data in object files that prevented implementing this, however that's been put into question recently:
> http://forum.dlang.org/post/mailman.508.1365074861.4724.digitalmars-d@puremagic.com

Yeah I can't reproduce this bug. h3r3tic also had some test-case
somewhere which I couldn't reproduce[1].

[1] : https://bitbucket.org/h3r3tic/xfbuild/issue/7/make-incremental-building-reliable


More information about the Digitalmars-d mailing list