Any takers for http://d.puremagic.com/issues/show_bug.cgi?id=9673?

Rainer Schuetze r.sagitario at gmx.de
Sun Mar 10 13:41:04 PDT 2013


On 10.03.2013 18:13, Andrei Alexandrescu wrote:
> On 3/10/13 7:25 AM, Rainer Schuetze wrote:
>> I don't have support for building on multiple cores, but trying it on
>> visuald itself (48 files) yields
>>
>> - combined compilation 6s
>> - single file compilation 1min4s
>>
>> You'd need a lot of cores to be better off with single file compilation.
>>
>> These are only the plugin files, not anything in the used libraries
>> (about 300 more files). Using dmd compiled with dmc instead of cl makes
>> these times 17s and 1min39s respectively)
>>
>> Almost any change causes a lot of files to be rebuilt (just tried one,
>> took 49s to build).
>
> I understand. However, I don't think that's not enough support for
> generalization.
>
> Phobos is 197KLOC. At work I work on a C++ project that has k more lines
> of code, where k is a small number. Phobos uses separate compilation for
> its unittests, which are quite thorough, and compiling and running them
> all with make -j8 takes under two minutes on one single laptop. (The use
> of -j is crucial.) Building from scratch the C++ project is a small
> tectonic event involving dozens of machines and lasting much longer than
> k times more.

I agree that rebuild times are usually much faster with D than in C++.

But please also consider the usual edit-debug-build cycle. At, work, 
where our C++ code base is maybe 100 times larger than Visual D, build 
times are usually below 10 seconds for edits to a few source files. My 
point is that import dependencies in D are more viral than C++ headers 
because you cannot even remove them in di-files (this would break 
initialization order).

>
> A large project is also more likely to manage dependencies in ways that
> reduce impact of individual file changes, something that apparently
> isn't the case for visuald.
>
> What I'm saying here is that incremental builds are a valid choice for
> certain projects, and is possibly a gating factor to building large
> codebases with rdmd.

I agree that incremental compilation would be good to have, I'm just 
saying that single file compilation is not the solution. We should aim 
at making it work to recompile all dependent files in one compiler 
invocation.



More information about the Digitalmars-d mailing list