On the performance of building D programs

Vladimir Panteleev vladimir at thecybershadow.net
Sun Apr 7 00:29:24 PDT 2013


On Saturday, 6 April 2013 at 17:52:40 UTC, Andrej Mitrovic wrote:
> But RDMD can track changes to dependencies, which DMD still 
> can't do.
> I want to try implementing this feature in DMD and see the speed
> difference for incremental builds.

By "incremental builds", do you mean skipping compilation of 
certain modules, and re-using object files from previous builds?

Currently, rdmd deletes all generated modules after building, to 
save disk space, as those modules are not reused in subsequent 
builds. The only thing that rdmd caches, is the full list of 
source files in the program (so it knows which files to check to 
see if they've been edited), and the executable.

Actual incremental compilation with just one compiler invocation 
would certainly be a big speedup for large projects. 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

I wonder if it's somehow related to Dicebot's findings in another 
recent thread:
http://forum.dlang.org/post/gxscuhrvcpnuzvgyykyp@forum.dlang.org

The compiler's verbose (-v) output, which is what rdmd currently 
uses, does not specify which modules depends on which - it simply 
lists all the files that took part in the compilation. There 
exists a separate option, -deps, which lists actual inter-module 
dependencies - judging by the identifiers, this is what rdmd used 
at some point. However, -deps output does not specify things such 
as import()-ed files. eskimor on IRC attempted to rectify that, 
here:
https://github.com/D-Programming-Language/dmd/pull/1839
However, as we've discussed, I think improving -v output would be 
better than adding a new switch to the compiler.


More information about the Digitalmars-d mailing list