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

James Lu jamtlu at gmail.com
Wed Aug 26 01:38:27 UTC 2020


On Wednesday, 26 August 2020 at 01:31:01 UTC, James Lu wrote:
> On Wednesday, 26 August 2020 at 01:13:47 UTC, James Lu wrote:
>> However, I suspect by the time the fastest and most balanced D 
>> compiler finishes compiling the program and executing it, V8 
>> will already have finished executing it.
>
> DMD -O doesn't make a significant difference over DMD, clocking 
> in at 12 seconds total.
>
> LDC2 -O/-O2 has the best compilation-execution total, clocking 
> in at 5.4 seconds. Subtracting the link time gets 5.0 seconds.
>
> Its code generation phase (measured by measuring the time 
> between -v's "code" and the link command) takes 2.6 seconds.
>
> In contrast, compilation+execution for V8 JavaScript 2.0 
> seconds. V8's --trace-opt says it compiles each function once, 
> and compilation (SSA creation, optimization, and code 
> generation) takes a grand total of 0.027 seconds.
>
> LDC's code generation is over 100 times slower. Surely there's 
> opportunities for profiling and optimization here. (dmd's code 
> generation is too bad to count.)

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.


More information about the Digitalmars-d mailing list