This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: penalty for member functions?


> >>>>> 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]