D for the Win

Mike via Digitalmars-d-announce digitalmars-d-announce at puremagic.com
Sun Aug 24 05:51:10 PDT 2014


On Sunday, 24 August 2014 at 09:24:55 UTC, Jacob Carlborg wrote:
> On 2014-08-24 10:53, bearophile wrote:
>> Dicebot:
>>
>>> In reddit thread one of commenters complained about D 
>>> performance and
>>> linked this benchmark :
>>
>> That benchmark found a small performance bug in ldc2, that I 
>> reported,
>> but I think it's not yet fixed.
>
> The numbers in the benchmark has just been updated. DMD is 
> behind C. GDC is the fastest of all and LDC is ahead of Clang 
> but behind GCC. Seems pretty good to me.

I did some analysis to find out which changes made the 
difference.  Here's my result.

1. Disabling the GC - insignificant
2. Liberal use of `immutable` - insignificant
3. Decorating functions with @trusted, @safe, nothrow, pure - 
insignificant
4. Using C's random number generator for both D and C - 
insignificant
5. Using C's floor instead of D's floor. - very significant (why?)
6. This change 
(https://github.com/nsf/pnoise/commit/baadfe20c7ae6aa900cb0e4188aa9d20bea95918) 
- very significant.

Mike



More information about the Digitalmars-d-announce mailing list