Idiot you say... Now, i don't know how the arrays actually work, but lets assume like you say that dynamic array doubles it on power of 2 margins.
Imagine that you have [0..0] pointer array of size 1024 and you increase the size by 1 for 10 times in a row. Dynamic array makes only 1 memory allocation of 2kb, but pointer array makes reservation total over 10kb (1025, 1026...1034)! In addition to that, it's like a puzzle game in the memory - having odd sized memory blocks of random 1023, 1050 etc are harder to organize than if the blocks are evenly sized.
(Oh, what also happens on array resizing, is existing memory copied to new array. Again Setlength() would win by big margin.)
I haven't noticed much of a performance difference at all if you use dynamic arrays vs pointer arrays for texture memory. For most arrays you don't ever need to resize it, and when you do, dynamic arrays might win in performance. Previously i have known that TList follows the memory doubling method, but i am not sure about setlength(). And there are likely some limitations in higher amounts of memory, smaller reservations.
Bookmarks