Two ideas for faster builds
Jonathan M Davis via Digitalmars-d
digitalmars-d at puremagic.com
Thu Jun 11 14:02:35 PDT 2015
On Thursday, 11 June 2015 at 07:49:35 UTC, Dmitry Olshansky wrote:
> On 11-Jun-2015 03:50, Andrei Alexandrescu wrote:
>> https://issues.dlang.org/show_bug.cgi?id=14679
>> https://issues.dlang.org/show_bug.cgi?id=14680
>>
>> Andrei
>
> Not processing templates is cool idea.
> However the main problem with DMD's build times on moderately
> sized projects is a huge memory leak in the compiler, mostly
> having to do with CTFE.
Yeah. Pretty much any and all performance improvements that we
can make should be made, and I don't think that they should be
discouraged unless there's actually something wrong with them.
But CTFE is the real killer. Improving that would probably
improve build times by at least an order of magnitude for
CTFE-heavy builds. Unfortunately, Don hasn't had time to work on
CTFE for the last year+, and while Daniel has some definite ideas
of how to improve it, he doesn't want to do that until we're
fully switched over to D for the compiler, since it'll be easier
to implement the changes there. So, we're unlikely to see any
improvements there until we've fully switched to ddmd unless
another compiler dev decides to take the plunge. At least we're
getting close to ddmd though.
The other fun one is the insane number of template instantations
we get for stuff like std.algorithm thanks to all of those helper
templates like isInputRange. IIRC, std.algorithm's unit tests
instantiate over a million different template instances - and
much of that is simply for template constraints and static ifs.
So, improving build times with regards to templates which are
instantiated would probably be the second largest gain to be had
behind CTFE if we could improve it, but obviously, we'd have to
make such improvements to be sure.
Regardless, the more that we can reasonably do to improve build
times, the better. And while we want to fix the big problems,
every little bit helps.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list