Is there any language that native-compiles faster than D?

H. S. Teoh hsteoh at quickfur.ath.cx
Wed Aug 26 04:24:30 UTC 2020


On Wed, Aug 26, 2020 at 01:31:01AM +0000, James Lu via Digitalmars-d wrote:
[...]
> DMD -O doesn't make a significant difference over DMD, clocking in at
> 12 seconds total.
[...]

DMD's optimizer is a joke compared to modern optimizing backends like
LDC/LLVM or GCC.  These days I don't even look at DMD for anything
remotely performance-related.  I consistently get 15-20% faster
executables from LDC than from DMD (even without any optimization
flags!), and for compute-heavy programs with -O2/-O3, the difference can
be up to 40-50%.  Now that LDC releases are closely tracking DMD
releases, I honestly have lost interest in DMD codegen quality, and only
use DMD for rapid prototyping during development. For everything else,
LDC is my go-to compiler.

(And don't even get me started on backend codegen bugs triggered by -O
and/or -inline. After getting bitten a few times by a couple of those, I
stay away from dmd -O / dmd -inline like the plague. If I want
optimization, I use LDC instead.)


On Wed, Aug 26, 2020 at 01:38:27AM +0000, James Lu via Digitalmars-d wrote:
[...]
> I wonder if anyone in the D community has the expertise to change
> modify or rewrite DMD's backend to be up to be at most 1.5-2x slower
> at normal, non-SIMD tasks, up to a poor version of LuaJIT or V8 while
> retaining the speed.

Supposedly Walter is one of the only people who understands the backend
well enough to be able to make significant improvements to it.

However, Walter is busy with other D-related stuff (important
language-level stuff), and we really don't want his time to be spent
optimizing a backend that, to be frank, almost nobody is interested in
these days. (I'm willing to be pleasantly surprised, though. If Walter
can singlehandedly clean up DMD's optimizer and hone it at least to the
same ballpark as LDC/GDC, then I'll be all ears. But I'm not holding my
breath.)


T

-- 
People say I'm indecisive, but I'm not sure about that. -- YHL, CONLANG


More information about the Digitalmars-d mailing list