AutoHotkey v1.0.92.02 Benchmarks

Contents

Control Group

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

1,000,000 iterations each

Assignment

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

1,000,000 iterations each

Comparison

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

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

 Return
0.000538
List comparison
If Variable In abcdef

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

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

 Return
0.000716

1,000,000 iterations each

String Searching

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

 Return
0.000688
List search statement
If Variable Contains abcdef

 Return
0.000781
String get position command
StringGetPos, Temp1, Variable, abcdef
0.000885
In string function
InStr(Variable,"abcdef")
0.000858

1,000,000 iterations each

Regular Expressions

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

500,000 iterations each

String Manipulation

BenchmarkCodeAverage time per run (ms)
Substring function
SubStr(Variable,2,3)
0.000915
String middle command
StringMid, Temp1, Variable, 2, 3
0.001068
String trim command
StringTrimLeft, Temp1, Variable, 1
0.001045
String replace command
StringReplace, Temp1, Variable, c, c, All
0.001248

1,000,000 iterations each

String Operations

BenchmarkCodeAverage time per run (ms)
String length function
StrLen(Variable)
0.000936
String length command
StringLen, Temp1, Variable
0.001013
String split command
StringSplit, Temp, Variable, c
0.001411
Case conversion
StringUpper, Temp1, Variable
0.001160

1,000,000 iterations each

Files

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

 Return
0.018620
Get size
FileGetSize, Temp1,%A_ScriptFullPath%
0.025317
Read file
FileRead, Temp1, *m100 %A_ScriptFullPath%
0.028633
Read file line
FileReadLine, Temp1, %A_ScriptFullPath%, 2
0.076499
Append to file
FileAppend, c, %A_Temp%\Temp.txt
0.126317
Copy file
FileCopy, %A_Temp%\Temp.txt, %A_Temp%\Temp1.txt, 1
0.275517
Move file
FileMove, %A_Temp%\Temp.txt, %A_Temp%\Temp.txt, 1
0.256726
Filesystem loop
Loop, %A_ScriptFullPath%

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

 Return
0.074388

5,000 iterations each

Control Flow

BenchmarkCodeAverage time per run (ms)
Normal loop
Loop

 Return
0.001345
While loop
While, 1

 Return
0.001345
Parsing loop
Loop, Parse, Variable

 Return
0.001542
Blank subroutine call
Gosub, BlankLabel
0.001470
Blank function call
BlankFunction()
0.001534

1,000,000 iterations each

Environment Variables

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

500,000 iterations each

Keyboard and mouse

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

5,000 iterations each

System Information

FieldValue
AutoHotkey VersionAutoHotkey v1.0.92.02 Unicode (x64)
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