If you speed something in v1 you need to add
SetBatchLines -1
e.g.
Code: Select all
; GLOBAL SETTINGS ===============================================================================================================
#NoEnv
SetBatchLines -1
global Init := DllCall("QueryPerformanceFrequency", "int64*", Freq)
global Count := 1000000
; 1st RUN =======================================================================================================================
DllCall("QueryPerformanceCounter", "int64*", S1)
loop % Count
{
string := "A..B.CD..E"
Array := StrSplit(string, "..")
for index, value in Array
continue
}
DllCall("QueryPerformanceCounter", "int64*", E1)
Time1 := ((E1 - S1) / Freq) * 1000
; 2nd RUN =======================================================================================================================
DllCall("QueryPerformanceCounter", "int64*", S2)
loop % Count
{
string := "A..B.CD..E"
ReplacedStr := StrReplace(string, "..", "`n")
loop, parse, ReplacedStr, `n
continue
}
DllCall("QueryPerformanceCounter", "int64*", E2)
Time2 := ((E2 - S2) / Freq) * 1000
; COMPARE =======================================================================================================================
MsgBox % Time1 "`n" Time2
; ===============================================================================================================================
Code: Select all
---------------------------
benchmark.ahk
---------------------------
857.831834
676.390168
---------------------------
OK
---------------------------