narrowed down the problem area

K.Wilson phizzzt at yahoo.com
Mon Oct 27 22:26:03 PDT 2008


I just finished initial support for x86-64 output with the ldc compiler (dmdfe attached to llvm backend) and wanted to do some timings, so I used the ray tracing code mentioned in this old thread. I compiled things with the same optimization flags mentioned in the thread and came up with these averages over 6 runs on an AMD x86-64 machine running Fedora Core Linux.

llvm-g++4.0.1   5.76
ldc-rev736      6.68
g++4.1.2        6.72
gdc0.24         7.45
g++4.3.1        7.66
dmd1.030        14.52

Seems like the LLVM backend is doing well (though I have seen other timings where g++4.x beats llvm-g++4.x, so take from this what you will).

I just thought I would let people know that ldc is coming along and performs quite well, at this point. And it has some x86-64 support now ;)

Thanks,
K.Wilson


bearophile Wrote:

> Sergey Gromov:
> > D program is refactored so that all struct manipulations happen in-place, 
> > without passing and returning by value.  GDC has troubles inlining 
> > static opCalls for some reason.
> 
> Yep, you seem to have re-invented a fixed-size version of my TinyVector (I have added static opCalls yesterday, but I may have to remove them again).
> 
> 
> > Microsoft's compiler produces FP/math code about 25% shorter than 
> > GCC/GDC in average
> 
> Nice.
> Thank you for your experiments.
> 
> Timings of your code (that has a bug, see downs for a fixed version) on Win, Pentium3, best of 3 runs, image 256x256:
> 
> D DMD v.1.025:
> bud -clean -O -release -inline rayD.d
> 15.8 seconds (memory deallocation too)
> 
> C++ MinGW based on GCC 4.2.1:
> g++ -O3 -s rayCpp.cpp -o rayCpp0
> 9.42 s (memory deallocation too)
> 
> C++ MinGW (the same):
> g++ -pipe -O3 -s -ffast-math -fomit-frame-pointer rayCpp.cpp -o rayCpp1
> 8.89 s (memory deallocation too)
> 
> C++ MinGW (the same):
> g++ -pipe -O3 -s -ffast-math -fomit-frame-pointer -fprofile-generate rayCpp.cpp -o rayCpp2
> g++ -pipe -O3 -s -ffast-math -fomit-frame-pointer -fprofile-use rayCpp.cpp -o rayCpp2
> 8.72 s (memory deallocation too)
> 
> I haven't tried GDC yet.
> 
> Bye,
> bearophile




More information about the Digitalmars-d mailing list