Performance dmd vs ldc2

Chris wendlec at tcd.ie
Thu Jul 25 02:44:36 PDT 2013


On Wednesday, 24 July 2013 at 16:56:40 UTC, David Nadlinger wrote:
> On 24 Jul 2013, at 14:49, Chris wrote:
>> Thanks for clarifying that. I am still impressed with the 
>> performance. Although I'm sure I could squeeze a bit
>> more out of dmd. As of now I'm only using the garden-variety 
>> (i.e. dmd -release [files]). I didn't use any
>> switches with ldc2, though.
>
> Never benchmark programs without at least some optimization 
> flags (e.g. -O for DMD). It does not allow you to draw any 
> conclusions, unless you really want to compare the performance 
> of the compilers for debug builds of your application (where 
> performance usually doesn't matter, except for in realtime-ish 
> applications).
>
> David

I did not do any benchmarking, to be honest. I just found it 
amazing that the ldc2 compiled program was up immediately (less 
than a second) and performed, whereas the read-and-parse 
operation at start-up takes 4 seconds in the dmd compiled 
version. One of the 4 files is an XML file that I parse with the 
bad old std.xml module. The remaining 3 are simple text files (no 
mark up) with simple regex parsing. Using the optimization 
switches (see earlier comment) with dmd did not help. I wonder 
why that is. Is it my code or dmd?


More information about the digitalmars-d-ldc mailing list