gdc and the Computer Language Benchmarks Game
Dave
Dave_member at pathlink.com
Fri Jun 29 16:27:43 PDT 2007
renoX wrote:
> 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
>>
On my machine at least, DMD 1.014 performs better than GDC 0.23 for a couple of the other current
tests, so it may be a wash in the end. But it would be nice if they'd put GDC up there too.
>> 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?
>
It looks like it's done with an intrinsics library, so it's probably right on the edge <g>.
> 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