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 insertion is always a pain at high counts. But under
50000-100000 don't worry too much.

See also this thread:
http://forum.lazarus-ide.org/index.php/topic,34348.msg226312.html#msg226312

(search for my post with "One can make the TStringlist problem also very 
visible with the
website")

I mostly use my generic version of the lightcontainer (which is basically an
array based map using multiple arrays instead of one), it is in the
benchmark above, also with int64/tdatetime etc as keys.
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to