Hans-Peter Diettrich wrote:


well thats soemthing you should add to your to do list. Automatic
inlining can deliver a signifcant performance improvement especially as
delphi uses a lot of one line procedures to set property values. A
fucntion call adds quite a bit of overhead (around 10+ clock cycles at a
guess)


Yes, inlining property getters/setters can speed up some code. I often
have methods that do nothing but an type cast.

I don't know what efforts were required to implement something like
{$AUTO_INLINE ON}. When the compiler already decides, which of the
explicitly marked "inline" procedures really to inline, such an option
might require not much additional code. The automatic checks could be
restricted to procedures up to a certain code size, e.g. 10 bytes
excluding subroutine enter/exit code. An -AutoInline <size> command line
option also could help to eliminate all those {$IFDEF fpc} inline
{$ENDIF} inserts in portable source code.


What would be nice is to have a compiler switch which takes say an 8bit value to indicate how many bytes a function must contain in order to be inlined automatically. That way it is scaleable and so wont exacerbate the executable file size problem too much.

jamie.

_______________________________________________
fpc-devel maillist  -  fpc-devel@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-devel

Reply via email to