Delphi dynamic array efficiency

Viewed 1304

I am not a Delphi expert and I was reading online about dynamic arrays and static arrays. In this article I have found a chapter called "Dynamic v. Static Arrays" with a code snippet and below the author says:

[...] access to a dynamic array can be faster than a static array!

I have understood that dynamic arrays are located on the heap (they are implemented with references/pointers).

So far I know that the access time is better on dynamic arrays. But is that the same thing with the allocation? Like if I called SetLength(MyDynArray, 5) is that slower than creating a MyArray = array[0..4] of XXX?

1 Answers
Related