[fpc-pascal] code optimization

stefan077 at web.de stefan077 at web.de
Fri Sep 24 15:24:54 CEST 2010

Hi Adrian,

"Adrian Veith" <adrian at veith-system.de> wrote:

>we optimized the code further and eliminated the all Next, Prev: Integer
>etc to and changed them to pointers again. Here are the results:
>first optimization - saving redundant array access to pointers:
>next optimization - changed code to use linked lists inside the arrays:
>fpc 7s = -41 % from opt1 = - 58% from orig
>delphi 6s = - 25% from opt1 = -33% from orig

I get the following values with the code you sent:
fpc: 4.51s  vs  Delphi: 3.05s on Intel Xeon and
fpc: 7.33s  vs  Delphi: 5.17s on Intel Core 2 mobile
so even for your optimized code delphi is more than 40% faster. 
Probably we use different delphi compilers. I got these results using Delphi 7.

>last optimized version of the code attached:

thanks a lot for the code, I used these ideas for the original code and it gave me a speedup of 20%.
WEB.DE DSL SOMMER-SPECIAL: Surf & Phone Flat 16.000 für 
nur 19,99 €/mtl.!* http://produkte.web.de/go/DSL_Doppel_Flatrate/2

More information about the fpc-pascal mailing list