Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-08 Thread Adriaan van Os
David Emerson wrote: Graeme Geldenhuys wrote: Martin Schreiber wrote: That happens with every reallocmem() with FPC memory manager so using a getmem() block instead of a dynamic array has no advantage in this Maybe a good old linked list implementation is the best performer then. Back to the

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-07 Thread David Emerson
Graeme Geldenhuys wrote: Martin Schreiber wrote: That happens with every reallocmem() with FPC memory manager so using a getmem() block instead of a dynamic array has no advantage in this Maybe a good old linked list implementation is the best performer then. Back to the Pascal of the 80's and

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-05 Thread Adriaan van Os
Martin Schreiber wrote: On 12/05/2016 10:52 AM, Jürgen Hestermann wrote: I love dynamic arrays and I never found that performance was an issue. Agreed. I find this big nonsene, but everybody his opinion. Take the time to study and profile the issue in detail or keep using dynamic arrays.

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-05 Thread Martin Schreiber
On 12/05/2016 10:52 AM, Jürgen Hestermann wrote: > > I love dynamic arrays and I never found that performance was an issue. > Agreed. Martin ___ fpc-pascal maillist - fpc-pascal@lists.freepascal.org http://lists.freepascal.org/cgi-bin/mailman/listinf

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-05 Thread Jürgen Hestermann
Am 2016-12-04 um 14:09 schrieb Graeme Geldenhuys: > On 2016-12-04 11:30, Martin Schreiber wrote: >> That happens with every reallocmem() with FPC memory manager so using a >> getmem() block instead of a dynamic array has no advantage in this > Maybe a good old linked list implementation is the bes

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Marco van de Voort
In our previous episode, Graeme Geldenhuys said: > If I use an array to hold a list of say Integers. Is there any serious > performance penalty for resizing (growing) the dynamic array as I add > items. My point being, I don't know the number of elements I'll need > beforehand. Yes, ordered insert

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Graeme Geldenhuys
On 2016-12-04 14:48, Adriaan van Os wrote: > It depends on the memory manager you use,... Wow, that's some interesting information there. Thanks for sharing. > There is nothing 80's or 90's about intelligent and advanced data structures. I simply meant, back in the day when I learned Turbo Pasc

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Adriaan van Os
Martin Schreiber wrote: On 12/04/2016 11:28 AM, Graeme Geldenhuys wrote: Hi, If I use an array to hold a list of say Integers. Is there any serious performance penalty for resizing (growing) the dynamic array as I add items. My point being, I don't know the number of elements I'll need beforeha

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Graeme Geldenhuys
On 2016-12-04 14:10, Dmitry Boyarintsev wrote: > You'll also need to store the actual size somewhere next to the dynamic > array, since you can no longer rely on length() How I'm longing for Java now. Java has a 101 different container classes as standard. And if that was not enough, you can now

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Dmitry Boyarintsev
On Sun, Dec 4, 2016 at 5:28 AM, Graeme Geldenhuys < mailingli...@geldenhuys.co.uk> wrote: > If I use an array to hold a list of say Integers. Is there any serious > performance penalty for resizing (growing) the dynamic array as I add > items. My point being, I don't know the number of elements I'

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Graeme Geldenhuys
On 2016-12-04 11:30, Martin Schreiber wrote: > That happens with every reallocmem() with FPC memory manager so using a > getmem() block instead of a dynamic array has no advantage in this Maybe a good old linked list implementation is the best performer then. Back to the Pascal of the 80's and 90'

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Martin Schreiber
On 12/04/2016 11:39 AM, Martin Schreiber wrote: > On 12/04/2016 11:28 AM, Graeme Geldenhuys wrote: >> Hi, >> >> If I use an array to hold a list of say Integers. Is there any serious >> performance penalty for resizing (growing) the dynamic array as I add >> items. My point being, I don't know the

Re: [fpc-pascal] performance when resizing a dynamic array

2016-12-04 Thread Martin Schreiber
On 12/04/2016 11:28 AM, Graeme Geldenhuys wrote: > Hi, > > If I use an array to hold a list of say Integers. Is there any serious > performance penalty for resizing (growing) the dynamic array as I add > items. My point being, I don't know the number of elements I'll need > beforehand. > The prob