Compilation times and idiomatic D code

H. S. Teoh via Digitalmars-d digitalmars-d at puremagic.com
Wed Jul 5 14:24:56 PDT 2017


On Wed, Jul 05, 2017 at 09:18:45PM +0000, jmh530 via Digitalmars-d wrote:
> On Wednesday, 5 July 2017 at 20:32:08 UTC, Stefan Koch wrote:
> > 
> > Yes there is.
> > Rainer Schuetze is quite close to a solution. Which reduces the
> > symbol-name bloat significantly.
> > See https://github.com/dlang/dmd/pull/5855

That's very nice.  Hope we will get this through sooner rather than
later!


[...]
> A table in the comments [1] shows a significant reduction in bloat
> when compiling phobos unit tests. However, it shows a slight increase
> in build time. I would have expected a decrease. Any idea why that is?
> 
> [1] https://github.com/dlang/dmd/pull/5855#issuecomment-310653542

The same comment points to a refactoring PR by Walter (dmd #6841). Not
sure why that PR would interact with this one in this way.

In any case, I think the actual compilation times would depend on the
details of the code.  If you're using relatively shallow UFCS chains,
like Phobos unittests tend to do, probably the compressed symbols won't
give very much advantage over the cost of computing the compression.
But if you have heavy usage of UFCS like in my code, this should cause
significant speedups from not having to operate on 300KB large symbols.


T

-- 
Help a man when he is in trouble and he will remember you when he is in trouble again.


More information about the Digitalmars-d mailing list