On 23 Sep 2010, at 16:59, Adrian Veith wrote:

I analyzed your code - I think the problem is the array element address
calculation of the fpc compiler. You have a lot of code like
Bar[MinValley] etc. The delphi compile uses the lea assembler code for
this, whereas fpc calculates the address of one element with imul which
is much slower.

Please see the last paragraph of 
http://lists.freepascal.org/lists/fpc-pascal/2010-September/026510.html

Anyway you could speed up your code significantly if you
help the compiler by reducing the address calculations with the help of
pointers like this:

It may help a lot, but only because it will reduce register pressure, not because the multiplications are gone.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/mailman/listinfo/fpc-pascal

Reply via email to