Using DMD's -v to build dependencies

Bill Baxter wbaxter at
Sat Dec 13 11:32:13 PST 2008

Excellent, thanks for collecting and reporting that data, Sergey.

So it's not too bad, but still that says to me that caching
dependencies would be beneficial for bigger programs.  But anyway, you
it would certainly be hard to beat your script in terms of simplicity.

Cached dependencies can be left as an exercise for the reader.  :-)


On Sun, Dec 14, 2008 at 3:35 AM, Sergey Gromov <snake.scaly at> wrote:
> Sat, 13 Dec 2008 07:37:18 +0900, Bill Baxter wrote:
>> So how fast is dmd -o-?  Does this pretty much double the compile time?
>> An option to reuse a previously generated .deps might be nice.
> Here's the benchmark.
> I'm compiling dwt-samples\examples\helloworld\HelloWorld5.d from dwt
> trunk rev. 119, without any pre-compilation.  The system is a 1.83 GHz
> Core2 Duo notebook under Win XP.  The compiler is DMD 1.033/Tango.
> The -c -o- -v stage takes 0.97 seconds (best of five, all files in
> memory, no swap).  The result is a list of 202 files in win-dwt.  That's
> more than a half of dwt (357 .d files).
> The actual build phase takes 3.27 seconds, best of five, etc.  The
> result is a working 1.7 MB executable.
> So the -v phase is at least 3 times faster than the actual compilation.
> Also note that in -o- mode the compiler misses some semantic errors
> which means it doesn't do full analysis.

More information about the Digitalmars-d mailing list