gdc and the Computer Language Benchmarks Game
Guido Schimmels
schimmi at iesy.net
Thu Jun 28 12:30:06 PDT 2007
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, 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