DMD is faster than LDC and GDC

John Colvin via Digitalmars-d digitalmars-d at puremagic.com
Thu Nov 12 11:45:58 PST 2015


On Thursday, 12 November 2015 at 19:11:25 UTC, tired_eyes wrote:
> On Thursday, 12 November 2015 at 14:44:49 UTC, John Colvin 
> wrote:
>>
>> To test the speed of fmttable itself I split fmttable and main 
>> in to different modules, made fmttable extern(C) so I could 
>> just prototype it in the main module (no import), then 
>> compiled them separately before linking. This should prevent 
>> any possible inlining/purity cleverness. ~1s for ldmd2, ~2s 
>> for dmd, which is business as normal.
>>
>> dmd is being clever and spotting that fmttable is pure, it 
>> would be good if ldc/gdc could spot this to.
>
> If so, should explicitly marking fmttable as pure close the gap 
> for initial code?

Well it won't do any harm, but it really depends on what the 
compiler chooses to do with the information.


More information about the Digitalmars-d mailing list