[pooma-dev] Runtime optimized/non-optimized

Richard Guenther rguenth at tat.physik.uni-tuebingen.de
Thu Apr 25 19:41:56 UTC 2002


On Thu, 25 Apr 2002, Nils H. Busch wrote:

> Hello,
> 
> I have a general question, I could not exactly answer myself.
> 
> Why is the runtime of Pooma code so much longer when running in debug
> mode (-g) compared to optimized code (-Ox), order of magnitude at least
> 10x? This concerns both apps compiled in both ways as also the library
> itself.
> Even for parts that are not Pooma related, there is a great runtime
> difference.
> I suspect, it has to do with the template expression mechanism, but I
> would like to understand exactly what the compiler does so differently.

The compiler usually refrains from inlining any functions with -g - and
inlining is essential for the expression template mechanism to work
with acceptable performance.

Try using -O -g instead - at least gcc does inlining with -O, so you
should get better performance while still being able to debug (with
some restrictions for the expression templates, of course).

Richard.

--
Richard Guenther <richard.guenther at uni-tuebingen.de>
WWW: http://www.tat.physik.uni-tuebingen.de/~rguenth/
The GLAME Project: http://www.glame.de/




More information about the pooma-dev mailing list