AutoHotkey v1.0.92.02 Benchmarks

Contents

Control Group

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

1,000,000 iterations each

Assignment

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

1,000,000 iterations each

Comparison

BenchmarkCodeAverage time per run (ms)
Classic If statement
If Variable = abcdef

 Return
0.000554
Expression If statement
If (Variable = "abcdef")

 Return
0.000609
List comparison
If Variable In abcdef

 Return
0.000619
Ternary
% (Variable = "abcdef") ? ""
0.000650
Classic If between
If Variable Between 123 And 124

 Return
0.000648
Expression If between
If (Variable >= 123 && Variable <= 124)

 Return
0.000804

1,000,000 iterations each

String Searching

BenchmarkCodeAverage time per run (ms)
String search statement
IfInString, Variable, abcdef

 Return
0.000752
List search statement
If Variable Contains abcdef

 Return
0.000824
String get position command
StringGetPos, Temp1, Variable, abcdef
0.000917
In string function
InStr(Variable,"abcdef")
0.000899

1,000,000 iterations each

Regular Expressions

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

500,000 iterations each

String Manipulation

BenchmarkCodeAverage time per run (ms)
Substring function
SubStr(Variable,2,3)
0.000989
String middle command
StringMid, Temp1, Variable, 2, 3
0.001147
String trim command
StringTrimLeft, Temp1, Variable, 1
0.001102
String replace command
StringReplace, Temp1, Variable, c, c, All
0.001280

1,000,000 iterations each

String Operations

BenchmarkCodeAverage time per run (ms)
String length function
StrLen(Variable)
0.001026
String length command
StringLen, Temp1, Variable
0.001082
String split command
StringSplit, Temp, Variable, c
0.001467
Case conversion
StringUpper, Temp1, Variable
0.001255

1,000,000 iterations each

Files

BenchmarkCodeAverage time per run (ms)
File attributes and exists function
FileExist(A_ScriptFullPath)
0.020400
If file exists
IfExist, %A_ScriptFullPath%

 Return
0.019305
Get size
FileGetSize, Temp1,%A_ScriptFullPath%
0.027497
Read file
FileRead, Temp1, *m100 %A_ScriptFullPath%
0.031245
Read file line
FileReadLine, Temp1, %A_ScriptFullPath%, 2
0.092516
Append to file
FileAppend, c, %A_Temp%\Temp.txt
0.146194
Copy file
FileCopy, %A_Temp%\Temp.txt, %A_Temp%\Temp1.txt, 1
0.260160
Move file
FileMove, %A_Temp%\Temp.txt, %A_Temp%\Temp.txt, 1
0.264665
Filesystem loop
Loop, %A_ScriptFullPath%

 Return
0.028568
File reading loop
Loop, Read, %A_ScriptFullPath%

 Return
0.089601

5,000 iterations each

Control Flow

BenchmarkCodeAverage time per run (ms)
Normal loop
Loop

 Return
0.001487
While loop
While, 1

 Return
0.001473
Parsing loop
Loop, Parse, Variable

 Return
0.001684
Blank subroutine call
Gosub, BlankLabel
0.001606
Blank function call
BlankFunction()
0.001679

1,000,000 iterations each

Environment Variables

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

500,000 iterations each

Keyboard and mouse

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

5,000 iterations each

System Information

FieldValue
AutoHotkey VersionAutoHotkey v1.0.92.02 Unicode (x86)
OS NameWindows 7 Professional x64
OS VersionNot Available
OS ConfigurationNot Available
OS Build TypeNot Available
System ManufacturerNot Available
System ModelNot Available
System TypeNot Available
Processor(s)Intel Core i7 CPU 860 @ 3.3GHz
BIOS VersionDell Computer Corporation A10, 12/01/2004
Total Physical Memory16,379 MB
Available Physical MemoryNot Available
Virtual Memory: Max SizeNot Available
Virtual Memory: AvailableNot Available