Here's a modification I made to the standard _ArrayAdd function from Array.au3. When used correctly, this function can drastically reduce the time needed to add multiple strings to an array without sacrificing any functionality. It has the same parameters as the standard _ArrayAdd function, but I've added a new one, which defaults to using the original if not used.
The code below is a minor modification to the example script from the help file, I just modified it to time how long the operation takes, as well as adding 10, 000 entries to an already existing array. The first loop uses the current method of adding strings to an array, one at a time. The second loop creates a single string delimited by the pipe ("|") character containing 10,000 substrings, and then adding all 10,000 entries to the array in one _ArrayAdd call instead of 10,000 of them. If you run this from SciTE you will see just how much faster this method is than the original. The timing takes into account building the 10,000 substrings so the test is at least closer to being fair.
The modified _ArrayAdd is in this demo script at the end of it, it is a drop in replacement for the original if you wanted to use it to replace it.
#include <Array.au3>
Global $avArray[10]
$avArray[0] = "JPM"
$avArray[1] = "Holger"
$avArray[2] = "Jon"
$avArray[3] = "Larry"
$avArray[4] = "Jeremy"
$avArray[5] = "Valik"
$avArray[6] = "Cyberslug"
$avArray[7] = "Nutster"
$avArray[8] = "JdeB"
$avArray[9] = "Tylo"
Global $avArray2[10]
$avArray2[0] = "JPM"
$avArray2[1] = "Holger"
$avArray2[2] = "Jon"
$avArray2[3] = "Larry"
$avArray2[4] = "Jeremy"
$avArray2[5] = "Valik"
$avArray2[6] = "Cyberslug"
$avArray2[7] = "Nutster"
$avArray2[8] = "JdeB"
$avArray2[9] = "Tylo"
_ArrayDisplay($avArray, "$avArray BEFORE _ArrayAdd()")
$Timer = TimerInit()
For $I = 1 To 10000
__ArrayAdd($avArray, "Test " & $I)
Next
ConsoleWrite("!Old method of _ArrayAdd = " & TimerDiff($Timer) / 1000 & @CRLF)
_ArrayDisplay($avArray, "$avArray AFTER _ArrayAdd()")
_ArrayDisplay($avArray2, "$avArray2 BEFORE _ArrayAdd()")
$Timer = TimerInit()
Global $sText = ""
For $I = 1 To 10000
$sText &= "Test " & $I & "|"
Next
$sText = StringTrimRight($sText, 1)
__ArrayAdd($avArray2, $sText, "|")
ConsoleWrite("+New method of _ArrayAdd = " & TimerDiff($Timer) / 1000 & @CRLF)
_ArrayDisplay($avArray2, "$avArray2 AFTER _ArrayAdd()")
Func __ArrayAdd(ByRef $avArray, $vValue, $sDelim = "")
If Not IsArray($avArray) Then Return SetError(1, 0, -1)
If UBound($avArray, 0) <> 1 Then Return SetError(2, 0, -1)
Local $iUBound = UBound($avArray), $aValue
If $sDelim <> "" Then
$aValue = StringSplit($vValue, $sDelim, 1) ; $STR_ENTIRESPLIT
If Not @error Then
ReDim $avArray[$iUBound + $aValue[0]]
For $Loop = 0 To $aValue[0] - 1
$avArray[$iUBound + $Loop] = $aValue[$Loop + 1]
Next
Return $iUBound + $aValue[0] - 1
Else
Return SetError(3, 0, -1)
EndIf
Else
ReDim $avArray[$iUBound + 1]
$avArray[$iUBound] = $vValue
Return $iUBound
EndIf
EndFunc ;==>__ArrayAdd
Enjoy!