Any and all good dynamic arrays (std::vector, AutoArray) have commands to grow and shrink allocations. We already have resize, but resize sets the objects to nil or a default state. What we need is to allocate the memory to hold x amount and set maxCount to x. This will allow us to pushBack without having to reallocate memory every push. If I know what size I need for my array, but I don't want a default values Reserve will vastly speed up the code because of no new memory allocation.
Example:
private _array = []; _array reverse 100; for "_i" from 1 to 100 do { _array pushBack _i; }; // _array is now [1..100] without having to allocate memory
Now sometimes it is nice to allocate more than needed and shrink the array to fit the size of elements.
private _array = []; _array reverse 100; for "_i" from 1 to 50 do { _array pushBack _i; }; shrinkToFit _array; // _array is [1..50] and only takes up 50 elements free the other 50 elements