narrowed down the problem area

bearophile bearophileHUGS at lycos.com
Sat Feb 16 06:20:46 PST 2008


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