[fpc-devel] Improved compiler speed by 20%

Peter Vreman peter at freepascal.org
Mon Nov 19 23:02:51 CET 2007


> Peter Vreman wrote:
>>
>> I gave the patch a quick try and the speed stays the same for compiling the compiler sources.
>> Can
>> you explain how you did measure the performance gain?
>>
> First, I compiled the compiler using -gl switch in order to have
> procedure names in logs.
> Then I compiled a project (it was my working copy of
> packages/fcl-xml/tests/xmlts.pp) using callgrind:
>
> valgrind --tool=callgrind ppc386 -S2h -dRELEASE -gl xmlts.pp
>
> Finally, annotated the log:
>
> callgrind_annotate --tree=calling >file.txt
>
> As a result, you get a file with call tree and execution times for most
> procedures. The numbers are very consistent across multiple runs.
> I observed decrease in "Program totals" number (I actually don't know
> what it is - CPU instructions, ticks or something arbitrary): from
> 410,867,243 to 302,717,628.
>
> I suspect that these numbers do not include time spent by kernel in disk
> i/o procedures, and that kernel time may be so high that it masks out
> all improvements. Also, I compiled a program with all used units already
> compiled, so in my case .ppu creation was not covered.
> But anyway, smaller numbers should be better than bigger ones.

Below are the number that i get when i compiled fppkg from r9259. These show only 3% improvement.
But also small bits help and i'll apply the patches after some cleanups.


Old compile all units:

==4852== I   refs:      1,649,289,307

Old PPU Load:

==4862== I   refs:      513,954,604


New compile all units:

==4280== I   refs:      1,634,900,650

New PPU load:

==4290== I   refs:      496,248,276


Peter





More information about the fpc-devel mailing list