Kyley
Harris wrote:
It all depends on your access pattern. For simple
groups of simple types, or records that you create, pass around a few
places, and then discard, a dynamic array is much cheaper - one call to
allocate/deallocate lots of entries - rather than lots of individual calls to
New and Dispose and/or Create. They're also reference counted for you (copy on
write) and Delphi takes care of all the memory management.
If order within the array is important and
insertion/deletion in the middle is common (so you can't move a single entry and
chop), their performance is O(N) so you're better of with a linked list or
similar indirect collection which has OO(log N) or O(1) insert/delete
behaviour.
TTFN,
Paul.
|
- [DUG]: Delete a variable from a Dynamic Array Jason Coley
- RE: [DUG]: Delete a variable from a Dynamic... Paul Heinz
- RE: [DUG]: Delete a variable from a Dynamic... Kyley Harris
- RE: [DUG]: Delete a variable from a Dyn... Paul Heinz
- RE: [DUG]: Delete a variable from a... Kyley Harris
- RE: [DUG]: Delete a variable fr... Paul Heinz
- RE: [DUG]: Delete a variab... Kyley Harris
- RE: [DUG]: Delete a va... Paul Heinz
- [DUG]: window iden... Alistair George
- RE: RE: [DUG]: Delete a variable from a Dy... Jason Coley
- RE: [DUG]: Delete a variable from a Dyn... Carl Reynolds \(E-mail\)
- RE: [DUG]: Delete a variable from a... Jason Coley
- RE: RE: RE: [DUG]: Delete a variable from... Allan, Samuel
- RE: RE: RE: RE: [DUG]: Delete a variable... Allan, Samuel