Compilation is taking a ton of memory

H. S. Teoh hsteoh at quickfur.ath.cx
Thu Jul 5 16:03:19 UTC 2018


On Wed, Jul 04, 2018 at 04:17:22PM -0400, Nick Sabalausky (Abscissa) via Digitalmars-d wrote:
[...]
> Long compilation times are almost always the fault of Dub. Dub is
> pretty well-known for taking DMD's near-instant compile times and
> bloating them out to the ridiculous (by D standards) lengths you're
> experiencing. I'd say try just writing a basic buildscript that runs
> DMD directly. Plus, that way you can customize it to your own
> project's needs: Which files/packages get compiled together, which get
> compiled separately.

Yeah, I'm sorry to say that I have been quite disappointed with dub (as
a build system), and currently have taken to avoiding it as much as
possible. As a packaging system it's not bad, but it simply doesn't have
the options I need to use it as a build tool.

But to be fair, it's not always dub's fault.  Heavy template / CTFE
usage is also known to bloat compilation times, sometimes by a lot.
Earlier this year I discovered that the very act of importing std.format
or std.regex causes compilation time to almost double.  There were some
issues related to compiling with -unittest that triggered this
behaviour, though we found that the underlying issue was actually more
tricky than it might first appear.  I don't remember if this issue has
been completely resolved yet.


T

-- 
Живёшь только однажды.


More information about the Digitalmars-d mailing list