[fpc-devel] Re: Comparison FPC 2.6.2 - Kylix 3

Daniël Mantione daniel.mantione at freepascal.org
Mon Mar 4 17:05:29 CET 2013



Op Mon, 4 Mar 2013, schreef luiz americo pereira camara:

> Is the bigger code just a side effect of a cross platform RTL or the
> generated code is really bigger / slower?

There are again multiple reasons. One is indeed that the code is 
multiple-platform and therefore some abstraction exist in the RTL. For 
example, widestring and threat managers mean more code, but make things 
more flexible.

Further: FPC tries to implement every Delphi feature, but also has unique 
features. Some of these unique features require runtime overhead and thus 
cause a bigger RTL.

Assembler implementations can reduce the size of the RTL, but FPC tries to 
focus on portability and has therefore relatively less assembler in the 
RTL.

Code generation quality is another factor. While FPC has in absolute terms 
more optimization power than Delphi, it misses a few crucial 
optimizations. For example, we don't have loop induction, which allows 
Delphi to beat FPC in code that stresses this.

Further, especially regarding Lazarus, the design of the LCL simply means 
that a lot of code is pulled into the executable. The Delphi VCL offers 
more possibilities for smart linking away unneeded code.

Daniël


More information about the fpc-devel mailing list