Performance dmd vs ldc2

David Nadlinger code at klickverbot.at
Wed Jul 24 09:53:57 PDT 2013


On 24 Jul 2013, at 14:11, bearophile wrote:
> Chris:
>
>> ldmd2 compiles the code much faster than ldc2 (~4 secs vs 14 secs). 
>> The program runs just as fast (as far as I can see at the moment).
> The ldmd2 binary is tiny, it's not a compiler, it's just a wrapper. If 
> the compilation time is different then
> they are can calling the compiler with different compilation switches.

ldmd uses the "-singleobj" flag by default (for DMD compatibility), 
which causes the code emitted for the n different D modules to be linked 
together into 1 LLVM module on the LLVM IR level, instead of emitting n 
LLVM modules as n object files and linking them with the system linker. 
This could be a factor, but the large difference is strange.

David


More information about the digitalmars-d-ldc mailing list