Updated compiler-benchmark

Per Nordlöw per.nordlow at gmail.com
Fri Jul 17 09:04:42 UTC 2020

On Thursday, 16 July 2020 at 23:36:58 UTC, IGotD- wrote:
> On Thursday, 16 July 2020 at 15:56:45 UTC, Per Nordlöw wrote:
>> D's compiler `dmd` is still far ahead of all its competition 
>> especially when it
>> comes to default build (standard compilation) performance.
> I don't think this comparison is fair as dmd is far behind when 
> it comes to code generation compared to the competitors. What 
> should be included are benchmarks done with LDC as well. Since 
> you already have the D code, adding LDC should be pretty easy.

Both dmd and ldc have superior check stage (lexical, syntactic 
and semantic analysis) because of a language designed in 
conjunction with the needs and limitations of a compiler. One 
key-property of such a design is that the D language is design to 
be a so called, single-pass language.

The compiler dmd is superior because of a super-fast but less 
qualitative code generation giving outstanding productivity 
incremental development. At that stage in the development cycle 
fast builds is much more important that optimized machine code. 
The machine code generated by dmd in this stage is sufficiently 
fast for the needs of the developer trying to be productive in 
this stage. That is by design, not by accident. I suggest you ask 
Walter Bright if you want more details around his design.

The compiler ldc is about 10x slower than dmd for the debug stage 
because of the larger overhead of the LLVM-backend and is often 
preferred when doing release builds.

More information about the Digitalmars-d-announce mailing list