Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / fpc-pascal / 2005-02

Dynamic arrays performance test.

5 messages · 4 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Agustin Barto

I ran some test of serveral Extended matrix internal representations to implement on an adaptation of Jedi_Math's matrix code (already contributed some of this modifications). In the attached file you'll see one of these tests. I have some questions about the results:

* The performance of the three internal structures is virtually the same. Which one do you think is the best?
* The program compiled with fpc 1.9.8 (on Linux) is two times slower than the one compiled with Delphi 7 (on Windows). Do you know what can I do to improve the performance with fpc?

Unknown author

In a message dated 3/1/2005 5:00:35 A.M. Central Standard Time, Agustin Barto writes:

I ran some test of several Extended matrix internal representations to implement on an adaptation of Jedi_Math's matrix code (already contributed some of this modifications). In the attached file you'll see one of these tests. I have some questions about the results:

* The performance of the three internal structures is virtually the same. Which one do you think is the best?
* The program compiled with fpc 1.9.8 (on Linux) is two times slower than the one compiled with Delphi 7 (on Windows). Do you know what can I do to improve the performance with fpc?

This would seem to be very interesting to explore, but being that it is related to
FPC 1.9.8 (which is still "release-candidate" i.e.. RC 2), it probably would get more attention if you posted it to the fpc-devel list rather than here.

Secondarily, I would suggest that comparing the performance of fpc on Linux to Delphi on Windows is somewhat like comparing the performance of a bicycle to that of a train. Way too many variables involved.

Florian Klaempfl
to Agustin Barto: I ran some test of serveral Extended matrix internal representations to implement on an…
Agustin Barto wrote 10 lines
I ran some test of serveral Extended matrix internal representations to implement on an adaptation of Jedi_Math's matrix code (already contributed some of this modifications). In the attached file you'll see one of these tests. I have some questions about the results: * The performance of the three internal structures is virtually the same. Which one do you think is the best? * The program compiled with fpc 1.9.8 (on Linux) is two times slower than the one compiled with Delphi 7 (on Windows). Do you know what can I do to improve the performance with fpc?

- use double instead of extended
- compile with -Cfsse2 on P4 CPUs
- FPC's random is probably more complex
- Test on _real_ world programs rather than on synthetic tests which allows compilers to cheat. We don't spend our time in useless optimizations as your inner loop requires because it don't help in properly written programs.

Jonas Maebe
to Florian Klaempfl
Florian Klaempfl wrote
- FPC's random is probably more complex

Indeed. I guess Delphi's is still a simple "(x * prime1) mod prime2" or so. FPC uses the Mersenne twister.

Jonas

Agustin Barto
to Jonas Maebe
Jonas Maebe wrote 9 lines
On 2 mrt 2005, at 07:29, Florian Klaempfl wrote: > - FPC's random is probably more complex Indeed. I guess Delphi's is still a simple "(x * prime1) mod prime2" or so. FPC uses the Mersenne twister. Jonas

Bingo. That was it. Now the fpc version is at least as fast as the Delphi version on the worst case and twice as fast using dynamic arrays.

Agustin