DIP 1016--ref T accepts r-values--Formal Assessment

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Feb 9 00:19:49 UTC 2019


On Sat, Feb 09, 2019 at 12:04:20AM +0000, Dennis via Digitalmars-d-announce wrote:
> On Friday, 8 February 2019 at 23:58:49 UTC, H. S. Teoh wrote:
> > Yep, the moral of the story is, if codegen quality is important to
> > you, use ldc (and presumably gdc too) rather than dmd.
> 
> That's definitely true, but that leaves the question whether lowering
> rvalue references to lambdas is acceptable. There's the 'dmd for fast
> builds, gdc/ldc for fast code' motto, but if your debug builds of your
> game make it run at 15 fps it becomes unusable. I don't want the gap
> between dmd and compilers with modern back-ends to widen.

TBH, I've been finding that ldc compilation times aren't all that bad
compared to dmd.  It's definitely slightly slower, but it's not anywhere
near the gap between, say, dmd and g++.

Recently I've been quite tempted to replace dmd with ldc as my main D
compiler, esp. now that ldc releases are essentially on par with dmd
releases in terms of release schedule of a particular language version.
The slowdown in compilation times isn't enough to offset the benefits,
as long as you're not compiling with, say, -O3 which *would* make the
ldc optimizer run slower (but with the huge benefit of significantly
better codegen -- I've seen performance improvements of up to ~200% with
ldc -O3 vs. dmd -O -inline).

And template-heavy code is slow across all D compilers anyway, so the
relatively small compilation time difference between dmd and ldc doesn't
really matter that much anymore once you have a sufficiently large
codebase with heavy template use.


T

-- 
What doesn't kill me makes me stranger.


More information about the Digitalmars-d-announce mailing list