[fpc-devel] Forwarded message about FPC statusy

Yury Sidorov jura at cp-lab.com
Tue Dec 25 13:39:56 CET 2012


From: "Marco van de Voort" <marcov at stack.nl>
> In our previous episode, Sven Barth said:
>> > and linked about 10 times as fast as FPC.
>>
>> AFAIK Delphi's command line compiler does not allow you to skip the
>> assembling and linking phase, so the fairest comparison would be to
>> compare the compilation of a single unit as there the linking phase 
>> is
>> skipped. If Delphi is still better there then there are two
>> possibilities: improve the internal assembler or the parser/code
>> generator. Please keep in mind though that FPC's code generator is
>> written in such a way that the backend can be switched rather 
>> easily. As
>> we learned with the developer's blog entries about Delphi XE2 this
>> wasn't the case with Delphi XE and older. So it could be that you 
>> can
>> never reach the speed of Delphi 7's compiler as FPC is more 
>> portable.
>
> The numbers Martin names (up till 10 times slower, even without 
> linking) are
> the numbers I have in mind too. IMHO denial without tests is unfair.
>
> I had a setup where I compiled zeos with FPC and Delphi (which 
> doesn't
> link), and iirc the results were also 7-10times, with delphi XE.

I also got similar results few years ago. Also I made some profiling 
and found a bottleneck in FPC. It is HUGE number of creations of small 
(or even tiny) objects (various compiler nodes). Each object creation 
allocates small chunk of memory and zero fills it. It is very time 
consuming.
It is possible to seed-up compilation by allocating memory for nodes 
from some zero pre-filled memory pool to avoid costly calls to heap 
manager and avoid zero filling of small memory chunks. A base class 
for various FPC nodes should be modified to handle aloocation from the 
pool...

Yury Sidorov, jura at cp-lab.com 



More information about the fpc-devel mailing list