[fpc-devel] don'tyou think it'stime toupdatedelphimodecompatibility?- IDispatch, implements

Hans-Peter Diettrich DrDiettrich at compuserve.de
Mon May 30 11:12:21 CEST 2005

Jamie McCracken wrote:

> > Yes, but the poster was asking whether the compiler never decided by
> > itself to inline something (even if no "inline" directive was
> > specified). That's not the case currently.
> 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.

Else I feel no urgent need for such an automatism.


More information about the fpc-devel mailing list