Slow performance compared to C++, ideas?

finalpatch fengli at gmail.com
Sat Jun 1 07:58:07 PDT 2013


Hi Andrei,

I have summarized the results with LDC on Mac OSX in a previous 
posts:

orignal: 760ms
* change v = [x,x,x] to v[0]=x... in this(float) constructor - 
540ms (220ms improvment)
* remove this(float[]) constructor and replace it with 
this(float,float,float) - 410ms (130ms improvment)
* "final" to all class methods - 350 (60ms improvment)
* hand unroll overloaded vector arithmetic operators, 260ms (90ms 
improvment)

However I retested on a windows 7 machine with GDC compiler and 
the results were very different.

orignal: 545ms
* the first 2 optimizations which helped the most on OSX with LDC 
has almost zero effect
* hand unroll overloaded vector arithmetic operators - 280ms 
(265ms improvment)
* "final" to all class methods - 200ms (80ms improvment)


On Saturday, 1 June 2013 at 13:36:44 UTC, Andrei Alexandrescu 
wrote:
>
> Would be great to collect a summary of the changes and their 
> benefits.
>
> Thanks finalpatch and everyone else for this work.
>
>
> Andrei



More information about the Digitalmars-d mailing list