From a C++/JS benchmark

bearophile bearophileHUGS at lycos.com
Sat Aug 6 16:46:53 PDT 2011


Iain Buclaw:

> Anyways, I've tweaked the GDC codegen, and program speed meets that of C++ now (on
> my system).

Are you willing to explain your changes (and maybe give a link to the changes)? Maybe Walter is interested for DMD too.


> Command-line:
> gdc -O3 -mfpmath=sse -ffast-math -march=native -frelease
> g++ bench.cc -O3 -mfpmath=sse -ffast-math -march=native

In newer versions of GCC -Ofast means -ffast-math too.

Walter is not a lover of that -ffast-math switch.
But I now think that the combination of D strongly pure functions with unsafe FP optimizations offers optimization opportunities that maybe not even GCC is able to use now when it compiles C/C++ code (do you see why?). Not using this opportunity is a waste, in my opinion.

Bye,
bearophile


More information about the Digitalmars-d mailing list