This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: penalty for member functions?
- To: Jason Merrill <jason at cygnus dot com>
- Subject: Re: penalty for member functions?
- From: Ulrich Lauther <ulrich dot lauther at mchp dot siemens dot de>
- Date: Sun, 21 Nov 1999 23:09:39 +0100 (MET)
- CC: gcc at gcc dot gnu dot org
- Reply-To: Ulrich dot Lauther at mchp dot siemens dot de
> >>>>> Ulrich Lauther <ulrich.lauther@mchp.siemens.de> writes:
>
> > global | member
> > function | function
> > -------------------
> > -O0 | 4.900 | 4.890
> > -O1 | 0.870 | 1.500
> > -O2 | 0.640 | 1.510
> > -O3 | 0.640 | 0.690
>
> > With -O1 and -O2, the member function is significantly slower than
> > the global function.
>
> The difference between -O2 and -O3 is -finline-functions, so I'll bet the
> member function just isn't being inlined.
>
of course it is not inlined, but it is called only once! The loop is inside
the function.
I would post the code, but it uses library calls, so I have to simplify
it first.
--
-lauther
----------------------------------------------------------------------------
Ulrich Lauther ph: +49 89 636 48834 fx: ... 636 42284
Siemens ZT SE 4 Internet: Ulrich.Lauther@mchp.siemens.de