[fpc-devel] FPC/Lazarus Rebuild performance

Florian Klämpfl florian at freepascal.org
Sun Sep 12 11:12:07 CEST 2010


Am 12.09.2010 10:39, schrieb Martin Schreiber:
> On Sunday, 12. September 2010 10.29:32 Florian Klämpfl wrote:
>>>
>>> And that results in a discrepancy of factor 5..10? I can't believe it.
>>
>> Digging out 1.0.10 and using some extreme example:
>>
>> C:\fpc\tests\webtbs>"c:\pp 1.0.10\bin\win32\ppc386.exe" tw2242 -O2
>> Free Pascal Compiler version 1.0.10 [2003/06/27] for i386
>> Copyright (c) 1993-2003 by Florian Klaempfl
>> Target OS: Win32 for i386
>> Compiling tw2242.pp
>> Linking tw2242.exe
>> 13083 Lines compiled, 0.8 sec
>>
>> C:\fpc\tests\webtbs>fpc tw2242 -O2
>> Free Pascal Compiler version 2.4.0 [2009/12/18] for i386
>> Copyright (c) 1993-2009 by Florian Klaempfl
>> Target OS: Win32 for i386
>> Compiling tw2242.pp
>> Linking tw2242.exe
>> 13083 lines compiled, 4.7 sec , 301376 bytes code, 1864 bytes data
> 
> Impressive. Now we can hook in. Where is the difference? What makes 2.4.0 so 
> much slower?

This is a very specific example which allows to explain rather simple
the slowness of 2.x: The reason is a decision geared by maintainability
and portability: 2.x uses a so-called graph colouring register allocator
while 1.x used a pretty simple register allocator specifically tailored
for i386.

The 2.x register allocator is more robust (no more internalerrors 10),
it is small (basically 2k lines, compiler/rgobj.pas) and it generates
reasonable register allocations on all types of CPUs (remember, FPC
supports CPUs with high register pressure like i386 as well as those
with a lot registers: PowerPC) we support, so we need only to maintain
one register allocator.



More information about the fpc-devel mailing list