#cs ---------------------------------------------------------------------------- AutoIt Version: 3.3.15.3 (Beta) Author: myName Script Function: Template AutoIt script. #ce ---------------------------------------------------------------------------- ; Script Start - Add your code below here ; Array.au3 is not used during this speed test #include "ArrayDisplayInternals2.au3" ; increased speed (listview fill & sort) #include #include Opt("MustDeclareVars", 1) Global $hTimer Example() ;================================================== Func Example() _SplashOn("1 - Filling Array") Local $iRowMax = 10000, $iColMax = 10, $aArray[$iRowMax][$iColMax] For $i = 0 To $iRowMax - 1 For $j = 0 To $iColMax - 1 $aArray[$i][$j] = "Row " & $i & " / Col " & $j Next Next _ArrayShuffle($aArray) SplashOff() MsgBox($MB_TOPMOST, "Shuffled Array is ready", "Click to launch _ArrayDisplay2") _SplashOn("2 - Populating Listview") AdLibRegister(TimeToLoad) $hTimer = TimerInit() _ArrayDisplay2($aArray, "Speed test ArrayDisplay2 Patched", Default, Default) ; , $ARRAYDISPLAY_TRANSPOSE) EndFunc ;==>Example ;================================================== Func TimeToLoad() ; Adlib If WinActive("Speed test ArrayDisplay2 Patched") Then ConsoleWrite(TimerDiff($hTimer) / 1000 & @lf) AdLibUnRegister(TimeToLoad) SplashOff() EndIf EndFunc ;==>Slider ;================================================== Func _SplashOn($sFirstLine, $sSecondLine = "please wait...") SplashTextOn("", $sFirstLine & @CRLF & $sSecondLine, _ 250, 50, -1, -1, $DLG_NOTITLE + $DLG_TEXTVCENTER) EndFunc ;==>_SplashOn ; #FUNCTION# ==================================================================================================================== ; Author ........: randallc, Ultima ; Modified.......: Gary Frost (gafrost), Ultima, Zedna, jpm, Melba23, AZJIO, UEZ - _ArrayDisplay() renamed _ArrayDisplay2() in this speed test ; =============================================================================================================================== Func _ArrayDisplay2(Const ByRef $aArray, $sTitle = Default, $sArrayRange = Default, $iFlags = Default, $vUser_Separator = Default, $sHeader = Default, $iMax_ColWidth = Default) #forceref $vUser_Separator Local $iRet = __ArrayDisplay_Share($aArray, $sTitle, $sArrayRange, $iFlags, Default, $sHeader, $iMax_ColWidth, 0, False) Return SetError(@error, @extended, $iRet) EndFunc ;==>_ArrayDisplay2 ; #FUNCTION# ==================================================================================================================== ; Author ........: Melba23 ; Modified.......: copied here because Array.au3 is not used during this speed test ; =============================================================================================================================== Func _ArrayShuffle(ByRef $aArray, $iStart_Row = 0, $iEnd_Row = 0, $iCol = -1) ; Fisher–Yates algorithm If $iStart_Row = Default Then $iStart_Row = 0 If $iEnd_Row = Default Then $iEnd_Row = 0 If $iCol = Default Then $iCol = -1 If Not IsArray($aArray) Then Return SetError(1, 0, -1) Local $iDim_1 = UBound($aArray, $UBOUND_ROWS) If $iEnd_Row = 0 Then $iEnd_Row = $iDim_1 - 1 If $iStart_Row < 0 Or $iStart_Row > $iDim_1 - 1 Then Return SetError(3, 0, -1) If $iEnd_Row < 1 Or $iEnd_Row > $iDim_1 - 1 Then Return SetError(3, 0, -1) If $iStart_Row > $iEnd_Row Then Return SetError(4, 0, -1) Local $vTmp, $iRand Switch UBound($aArray, $UBOUND_DIMENSIONS) Case 1 For $i = $iEnd_Row To $iStart_Row + 1 Step -1 $iRand = Random($iStart_Row, $i, 1) $vTmp = $aArray[$i] $aArray[$i] = $aArray[$iRand] $aArray[$iRand] = $vTmp Next Return 1 Case 2 Local $iDim_2 = UBound($aArray, $UBOUND_COLUMNS) If $iCol < -1 Or $iCol > $iDim_2 - 1 Then Return SetError(5, 0, -1) Local $iCol_Start, $iCol_End If $iCol = -1 Then $iCol_Start = 0 $iCol_End = $iDim_2 - 1 Else $iCol_Start = $iCol $iCol_End = $iCol EndIf For $i = $iEnd_Row To $iStart_Row + 1 Step -1 $iRand = Random($iStart_Row, $i, 1) For $j = $iCol_Start To $iCol_End $vTmp = $aArray[$i][$j] $aArray[$i][$j] = $aArray[$iRand][$j] $aArray[$iRand][$j] = $vTmp Next Next Return 1 Case Else Return SetError(2, 0, -1) EndSwitch EndFunc ;==>_ArrayShuffle