AutoHotkey v1.0.48.05 Benchmarks

Contents

Control Group

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

1,000,000 iterations each

Assignment

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

1,000,000 iterations each

Comparison

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

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

 Return
0.000992
List comparison
If Variable In abcdef

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

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

 Return
0.001436

1,000,000 iterations each

String Searching

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

 Return
0.001316
List search statement
If Variable Contains abcdef

 Return
0.001453
String get position command
StringGetPos, Temp1, Variable, abcdef
0.001595
In string function
InStr(Variable,"abcdef")
0.001601

1,000,000 iterations each

Regular Expressions

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

500,000 iterations each

String Manipulation

BenchmarkCodeAverage time per run (ms)
Substring function
SubStr(Variable,2,3)
0.001674
String middle command
StringMid, Temp1, Variable, 2, 3
0.001955
String trim command
StringTrimLeft, Temp1, Variable, 1
0.001907
String replace command
StringReplace, Temp1, Variable, c, c, All
0.002535

1,000,000 iterations each

String Operations

BenchmarkCodeAverage time per run (ms)
String length function
StrLen(Variable)
0.001683
String length command
StringLen, Temp1, Variable
0.001804
String split command
StringSplit, Temp, Variable, c
0.002541
Case conversion
StringUpper, Temp1, Variable
0.002221

1,000,000 iterations each

Files

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

 Return
0.030139
Get size
FileGetSize, Temp1,%A_ScriptFullPath%
0.035150
Read file
FileRead, Temp1, *m100 %A_ScriptFullPath%
0.106955
Read file line
FileReadLine, Temp1, %A_ScriptFullPath%, 2
0.073964
Append to file
FileAppend, c, %A_Temp%\Temp.txt
3.322407
Copy file
FileCopy, %A_Temp%\Temp.txt, %A_Temp%\Temp1.txt, 1
1.680939
Move file
FileMove, %A_Temp%\Temp.txt, %A_Temp%\Temp.txt, 1
0.459294
Filesystem loop
Loop, %A_ScriptFullPath%

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

 Return
0.092295

5,000 iterations each

Control Flow

BenchmarkCodeAverage time per run (ms)
Normal loop
Loop

 Return
0.002377
While loop
While, 1

 Return
0.002458
Parsing loop
Loop, Parse, Variable

 Return
0.003103
Blank subroutine call
Gosub, BlankLabel
0.002643
Blank function call
BlankFunction()
0.002777

1,000,000 iterations each

Environment Variables

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

500,000 iterations each

Keyboard and mouse

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

5,000 iterations each

System Information

FieldValue
AutoHotkey VersionAutoHotkey v1.0.48.05 ANSI (x86)
OS NameWindows XP Professional
OS Version5.1 N/A Build 2600
OS ConfigurationNot Available
OS Build TypeNot Available
System ManufacturerAcer, inc.
System ModelAspire 3000
System TypeX86-based PC
Processor(s)Mobile AMD Sempron(tm) Processor 3300+, MMX, 3DNow, ~2.0GHz
BIOS VersionPhoenix NoteBIOS 4.0 Release 6.0
Total Physical Memory446 MB
Available Physical MemoryNot Available
Virtual Memory: Max Size1,052 MB
Virtual Memory: Available627 MB