AutoHotkey v1.0.92.02 Benchmarks

Contents

Control Group

BenchmarkCodeAverage time per run (ms)
Blank Run
(None)
0.000387

1,000,000 iterations each

Assignment

BenchmarkCodeAverage time per run (ms)
Classic
Variable = Lorem ipsum dolor sit amet
0.000549
Expression
Variable := "Lorem ipsum dolor sit amet"
0.000656

1,000,000 iterations each

Comparison

BenchmarkCodeAverage time per run (ms)
Classic If statement
If Variable = abcdef
 Return
0.000695
Expression If statement
If (Variable = "abcdef")
 Return
0.000739
List comparison
If Variable In abcdef
 Return
0.000760
Ternary
% (Variable = "abcdef") ? ""
0.000813
Classic If between
If Variable Between 123 And 124
 Return
0.000797
Expression If between
If (Variable >= 123 && Variable <= 124)
 Return
0.000955

1,000,000 iterations each

String Searching

BenchmarkCodeAverage time per run (ms)
String search statement
IfInString, Variable, abcdef
 Return
0.000927
List search statement
If Variable Contains abcdef
 Return
0.001062
String get position command
StringGetPos, Temp1, Variable, abcdef
0.001144
In string function
InStr(Variable,"abcdef")
0.001205

1,000,000 iterations each

Regular Expressions

BenchmarkCodeAverage time per run (ms)
Match function
RegExMatch(Variable,"S)abcdef")
0.001789
Replace function
RegExReplace(Variable,"S)c")
0.003041

500,000 iterations each

String Manipulation

BenchmarkCodeAverage time per run (ms)
Substring function
SubStr(Variable,2,3)
0.001400
String middle command
StringMid, Temp1, Variable, 2, 3
0.001545
String trim command
StringTrimLeft, Temp1, Variable, 1
0.001508
String replace command
StringReplace, Temp1, Variable, c, c, All
0.001825

1,000,000 iterations each

String Operations

BenchmarkCodeAverage time per run (ms)
String length function
StrLen(Variable)
0.001237
String length command
StringLen, Temp1, Variable
0.001329
String split command
StringSplit, Temp, Variable, c
0.001894
Case conversion
StringUpper, Temp1, Variable
0.001588

1,000,000 iterations each

Files

BenchmarkCodeAverage time per run (ms)
File attributes and exists function
FileExist(A_ScriptFullPath)
0.039106
If file exists
IfExist, %A_ScriptFullPath%
 Return
0.038591
Get size
FileGetSize, Temp1,%A_ScriptFullPath%
0.049328
Read file
FileRead, Temp1, *m100 %A_ScriptFullPath%
0.067146
Read file line
FileReadLine, Temp1, %A_ScriptFullPath%, 2
0.149445
Append to file
FileAppend, c, %A_Temp%\Temp.txt
0.921480
Copy file
FileCopy, %A_Temp%\Temp.txt, %A_Temp%\Temp1.txt, 1
0.626523
Move file
FileMove, %A_Temp%\Temp.txt, %A_Temp%\Temp.txt, 1
0.825436
Filesystem loop
Loop, %A_ScriptFullPath%
 Return
0.051341
File reading loop
Loop, Read, %A_ScriptFullPath%
 Return
0.143793

5,000 iterations each

Control Flow

BenchmarkCodeAverage time per run (ms)
Normal loop
Loop
 Return
0.001853
While loop
While, 1
 Return
0.001890
Parsing loop
Loop, Parse, Variable
 Return
0.002562
Blank subroutine call
Gosub, BlankLabel
0.002100
Blank function call
BlankFunction()
0.002192

1,000,000 iterations each

Environment Variables

BenchmarkCodeAverage time per run (ms)
Set environment variable
EnvSet, EnvVar, abcdeg
0.004121
Get environment variable
EnvGet, Temp1, EnvVar
0.002128

500,000 iterations each

Keyboard and mouse

BenchmarkCodeAverage time per run (ms)
Get mouse position
MouseGetPos, Temp1, Temp2
0.004747
Move mouse
MouseMove, 0, 0, 0, R
10.109600

5,000 iterations each

System Information

FieldValue
AutoHotkey VersionAutoHotkey v1.0.92.02
OS NameNot Available
OS VersionNot Available
OS ConfigurationNot Available
OS Build TypeNot Available
System ManufacturerNot Available
System ModelNot Available
System TypeNot Available
Processor(s)Not Available
BIOS VersionNot Available
Total Physical MemoryNot Available
Available Physical MemoryNot Available
Virtual Memory: Max SizeNot Available
Virtual Memory: AvailableNot Available