Re: GDC vs dmd speed

2013-10-15 Thread Paul Jurczak
On Monday, 14 October 2013 at 19:24:27 UTC, Spacen Jasset wrote: Hello, Whilst porting some C++ code I have discovered that the compiled output from the gdc compiler seems to be 47% quicker than the dmd compiler. Here is a few more data points for microbenchmarks of simple functions

Re: GDC vs dmd speed

2013-10-15 Thread John Colvin
On Monday, 14 October 2013 at 19:24:27 UTC, Spacen Jasset wrote: gdc 4.6 (0.29.1-4.6.4-1ubuntu4) Which I assume might be v2.020? with flags: [-O2] That's a really old gdc. If you can, upgrade to ubuntu 13.10 and you'll get a more up-to-date version. Alternatively, build from source:

Re: GDC vs dmd speed

2013-10-15 Thread Spacen Jasset
On 14/10/2013 22:06, bearophile wrote: Spacen Jasset: const float pi = 3.14159265f; float dx = cast(float)(Clock.currSystemTick.length % (TickDuration.ticksPerSec * 10)) / (TickDuration.ticksPerSec * 10); float xRot = sin(dx * pi * 2) * 0.4f + pi / 2; float yRot = cos(dx * pi

Re: GDC vs dmd speed

2013-10-15 Thread Spacen Jasset
On 14/10/2013 22:22, Walter Bright wrote: On 10/14/2013 12:24 PM, Spacen Jasset wrote: dmd32 v2.063.2 with flags: [-O, -release, -noboundscheck, -inline] gdc 4.6 (0.29.1-4.6.4-1ubuntu4) Which I assume might be v2.020? with flags: [-O2] dmd uses the x87 for 32 bit code for floating point,

GDC vs dmd speed

2013-10-14 Thread Spacen Jasset
Hello, Whilst porting some C++ code I have discovered that the compiled output from the gdc compiler seems to be 47% quicker than the dmd compiler. The code I believe that is the 'busy' code is below. Although I could provide a complete test if anyone is interested. Is this an expected

Re: GDC vs dmd speed

2013-10-14 Thread jerro
Although I could provide a complete test if anyone is interested. Is this an expected result and/or is there something I could change to make the compilers perform similarly. Maybe you could do something to make the code compiled with DMD perform better, but it is not unusual for GDC to

Re: GDC vs dmd speed

2013-10-14 Thread bearophile
Spacen Jasset: const float pi = 3.14159265f; float dx = cast(float)(Clock.currSystemTick.length % (TickDuration.ticksPerSec * 10)) / (TickDuration.ticksPerSec * 10); float xRot = sin(dx * pi * 2) * 0.4f + pi / 2; float yRot = cos(dx * pi * 2) * 0.4f; float yCos =

Re: GDC vs dmd speed

2013-10-14 Thread Walter Bright
On 10/14/2013 12:24 PM, Spacen Jasset wrote: dmd32 v2.063.2 with flags: [-O, -release, -noboundscheck, -inline] gdc 4.6 (0.29.1-4.6.4-1ubuntu4) Which I assume might be v2.020? with flags: [-O2] dmd uses the x87 for 32 bit code for floating point, while gdc uses the SIMD instructions, which