On 2015-09-26 01:53, anonymous wrote:

Compiling one file at a time is yet another thing.

1) Compile everything into one object file:
dmd -c -ofresult.o foo.d bar.d
2) Compile to multiple object files in one run:
dmd -c foo.d bar.d
3) Compile to multiple object files in multiple runs:
dmd -c foo.d; dmd -c bar.d

Since you didn't know about 2, I take it that you measured 1 vs 3. 3 is
bound to be slower when the modules share dependencies, because they have to
be parsed again and again.

2 may be faster or slower than 1, I don't know, a quick check didn't show a
difference. When the template instantiation issue ever gets fixed, I
wouldn't be surprised if 2 got slower than 1. Of course, any slowness of 2
must then be weighed against 1 compiling more than necessary.

In theory 2 should be faster when it comes to recompiling because fewer files need to be recompiled.

/Jacob Carlborg

Reply via email to