Inlining methods of published classes inside the lib?

Alexander Neundorf neundorf at kde.org
Thu Apr 16 22:03:06 CEST 2009


Hi Friedrich,

On Thursday 16 April 2009, Friedrich W. H. Kossebau wrote:
...
> ? How big is the cost of a method call compared to a inlined, simple
> function, e.g. readonly precalculated data access? So might it have a real
> effect? ? What measures could be taken to find gain vs. costs, and how?

I checked this once when building for ARM. Everything inlined it was something 
between 5 and 15 assembler instructions, without inlining it was 
significantly more (I think it was returning a free element from a pool).
So, for really simple functions it is significant.

If you change into the directory where the target, e.g. okteta, is built, you 
can do "make help" there, and then you will see among other also targets to 
compile all files separately (make file.o) , to preprocess (make file.i) them 
and to assemble (make file.s) them (actually do everything except 
assembling...).
When you do this you can see what the result will be.

Alex


More information about the Kde-optimize mailing list