[fpc-pascal] Is Delphi7 on Windows to FPC on embedded Linux possible?

2010-09-24 Thread Bo Berglund
This may be a stupid question, but I just discovered FPC so please bear with me... I have been writing Delphi programs since 1996 or so (when Delphi 2 was released), so I am rather comfortable with that. Now I need to write for the Linux platform because we are trying to make a Linux front end

Re: [fpc-pascal] code optimization

2010-09-24 Thread Jürgen Hestermann
stefan...@web.de schrieb: My experience is that linked lists with pointers are much slower than linked lists realized by arrays. That's my experience too. I converted a few programs from linked lists to array of pointers and the speed increase was always dramatically. _

Re: [fpc-pascal] code optimization

2010-09-24 Thread Adrian Veith
On 24.09.2010 14:35, Jonas Maebe wrote: > > On 24 Sep 2010, at 11:48, Adrian Veith wrote: > >> Changing to pointers reduces the amount of multiplications for accessing >> the nth element in an array - if you compare the delphi code to th fpc >> code on assembler base, this is the main difference

Re: [fpc-pascal] code optimization

2010-09-24 Thread Jonas Maebe
On 24 Sep 2010, at 14:35, Jonas Maebe wrote: On 24 Sep 2010, at 11:48, Adrian Veith wrote: Register allocation is on a comparable level for both versions. Delphi keeps the "Bar" pointer in a register, while FPC spills it to the stack. Because Bar is used in most of the most-executed sta

Re: [fpc-pascal] code optimization

2010-09-24 Thread stefan077
Hi Adrian, "Adrian Veith" 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 u

Re: [fpc-pascal] code optimization

2010-09-24 Thread Jonas Maebe
On 24 Sep 2010, at 11:48, Adrian Veith wrote: Changing to pointers reduces the amount of multiplications for accessing the nth element in an array - if you compare the delphi code to th fpc code on assembler base, this is the main difference in both generated codes. Did you actually try rep

Re: [fpc-pascal] code optimization

2010-09-24 Thread Adrian Veith
On 24.09.2010 10:37, Jonas Maebe wrote: > > On 24 Sep 2010, at 08:06, Adrian Veith wrote: > >> On 23.09.2010 17:03, Jonas Maebe wrote: >>> >>> It may help a lot, but only because it will reduce register pressure, >>> not because the multiplications are gone. >> >> It reduces the total number of m

Re: [fpc-pascal] code optimization

2010-09-24 Thread Jonas Maebe
On 24 Sep 2010, at 08:06, Adrian Veith wrote: On 23.09.2010 17:03, Jonas Maebe wrote: It may help a lot, but only because it will reduce register pressure, not because the multiplications are gone. It reduces the total number of multiplications about 70% - I gave the code to one of my guys