gdc and the Computer Language Benchmarks Game

renoX renosky at free.fr
Fri Jun 29 12:19:15 PDT 2007


Guido Schimmels a écrit :
> Hello,
> 
> I've been curious last night, how D does in the language shootout: 
> http://shootout.alioth.debian.org/gp4/
> 
> It's reasonably close to C or C++ with dmd - good. Then I looked
> where D fares especially bad. That's a) mandelbrot: factor 2.0 slower
> than both C and C++ and b) recursive: factor 2.5 slower than C and
> factor 2.7 slower than C++
> 
> So I wanted to know, if gdc makes a difference here -  and boy it
> does. mandelbrot.d: gdc beats dmd by factor 1.8 recursive.d: gdc
> beats dmd by factor 2.22
> 
> compiler: dmd-1.015, gdc-0.23, gcc-4.1.1 (i686-linux) command line:
> (g)dmd -O -inline -release
> 
> So gdc gets those within 5%-10% range of GNU C/C++. In the mandelbrot
> case this is especially remarkable, since both the C and C++ code is
> hand-tweaked for SSE2, 

Uh? I thought that it was against the rule of this shootout to do this 
kind of optimisation?

Otherwise, you could include assembly code in a D program and benchmark 
it as a D program which obviously it isn't..

Regards,
renoX

>while the D code is generic straight-foward
> fp.
> 
> In light of this, gdc compiled D might even end up topping that list.
>  So I wish the D community makes sure not to miss that opportunity to
> promote the language.
> 
> Guido



More information about the Digitalmars-d mailing list