Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
22 lines (19 sloc) 12.1 KB
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<!-- saved from url=(0094)http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html -->
<html><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><title>AutoHotkey Benchmarks</title><style>body{background:#F3F3F3;font-family:Constantia,"Lucida Serif",Lucida,"DejaVu Serif","Bitstream Vera Serif","Liberation Serif",Georgia,serif;margin:2em;font-size:1em;color:#BBBBBB;}table{width:100%;border-collapse:collapse;color:#707070;}h1{font-size:2.8em;text-shadow:#555555 0 -1px 0.04em;color:#D5D5D5;text-align:center;}h2{font-size:1.9em;text-shadow:#555555 0 -1px 0.035em;}td,th{background:#D0D0D0;text-shadow:#FFFFFF 0 0.5px 0.3em;border:1px solid #D5D5D5;padding:0.2em;}th{font-size:1.2em;text-align:left;background-color:#E0E0E0;text-shadow:#888888 0 -1px 0.04em;color:#AAAAAA;}tr.alt td{background-color:#BFBFBF;}pre{background-color:#6F6F6F;margin:0.1em;padding:0.4em;font-size:0.8em;font-family:"Courier New",Courier,monospace;color:#FFFFFF;-webkit-border-radius:0.2em;-moz-border-radius:0.2em;border-radius:0.2em;}ul{padding:1em;background-color:#E5E5E5;-webkit-box-shadow:inset 1px 2px 0.3em #555555;-moz-box-shadow:inset 1px 2px 0.3em #555555;box-shadow:inset 1px 2px 0.3em #555555;line-height:1.5;width:13em;list-style-type:none;}a{text-shadow:#FFFFFF 0 0.5px 0.3em;}a:link{color:#A0A0A0;}a:visited{color:#B8B8B8;}a:hover{color:#FFFFFF;}</style></head><body><h1>AutoHotkey Benchmarks</h1><h2 id="Contents">Contents</h2><ul><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#ControlGroup">Control Group</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#Assignment">Assignment</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#Comparison">Comparison</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#StringSearching">String Searching</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#RegularExpressions">Regular Expressions</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#StringManipulation">String Manipulation</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#StringOperations">String Operations</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#Files">Files</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#ControlFlow">Control Flow</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#EnvironmentVariables">Environment Variables</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#Keyboardandmouse">Keyboard and mouse</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#DynamicVariables">Dynamic Variables</a></li><li><a href="http://www.autohotkey.net/~Rseding91/Benchmarks/Desktop/Benchmarks%20v1.1.06.02%20Unicode.html#SystemInformation">System Information</a></li></ul><h2 id="ControlGroup">Control Group</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Blank Run</td><td><pre>(None)</pre></td><td>0.000380</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="Assignment">Assignment</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Classic</td><td><pre>Variable = Lorem ipsum dolor sit amet</pre></td><td>0.000527</td></tr><tr><td>Classic with variable</td><td><pre>Variable = Lorem ipsum %OtherVariable% dolor sit amet</pre></td><td>0.000592</td></tr><tr class="alt"><td>Expression</td><td><pre>Variable := "Lorem ipsum dolor sit amet"</pre></td><td>0.000672</td></tr><tr><td>Expression with variable</td><td><pre>Variable := "Lorem ipsum" . OtherVariable . " dolor sit amet"</pre></td><td>0.000879</td></tr><tr class="alt"><td>Expression explicit concatenation</td><td><pre>Variable := "Lorem ipsum" . " dolor sit amet"</pre></td><td>0.000806</td></tr><tr><td>Expression implicit concatenation</td><td><pre>Variable := "Lorem ipsum" " dolor sit amet"</pre></td><td>0.000834</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="Comparison">Comparison</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Classic If statement</td><td><pre>If Variable = abcdef
Return</pre></td><td>0.000781</td></tr><tr><td>Expression If statement</td><td><pre>If (Variable = "abcdef")
Return</pre></td><td>0.000838</td></tr><tr class="alt"><td>List comparison</td><td><pre>If Variable In abcdef
Return</pre></td><td>0.000896</td></tr><tr><td>Ternary</td><td><pre>% (Variable = "abcdef") ? "" : ""</pre></td><td>0.000983</td></tr><tr class="alt"><td>Classic If between</td><td><pre>If Variable Between 123 And 124
Return</pre></td><td>0.000960</td></tr><tr><td>Expression If between</td><td><pre>If (Variable &gt;= 123 &amp;&amp; Variable &lt;= 124)
Return</pre></td><td>0.001172</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="StringSearching">String Searching</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>String search statement</td><td><pre>IfInString, Variable, abcdef
Return</pre></td><td>0.001060</td></tr><tr><td>List search statement</td><td><pre>If Variable Contains abcdef
Return</pre></td><td>0.001124</td></tr><tr class="alt"><td>String get position command</td><td><pre>StringGetPos, Temp1, Variable, abcdef</pre></td><td>0.001272</td></tr><tr><td>In string function</td><td><pre>InStr(Variable,"abcdef")</pre></td><td>0.001220</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="RegularExpressions">Regular Expressions</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Match function</td><td><pre>RegExMatch(Variable,"S)ab.*?.f$")</pre></td><td>0.001349</td></tr><tr><td>Replace function</td><td><pre>RegExReplace(Variable,"S)ab.*?.f$","$0")</pre></td><td>0.001432</td></tr><tr class="alt"><td>Static match</td><td><pre>RegExMatch(Variable,"S)abcdef")</pre></td><td>0.001374</td></tr><tr><td>Static replace</td><td><pre>RegExReplace(Variable,"c","c")</pre></td><td>0.001985</td></tr></tbody></table><p>500,000 iterations each</p><h2 id="StringManipulation">String Manipulation</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Substring function</td><td><pre>SubStr(Variable,2,3)</pre></td><td>0.001387</td></tr><tr><td>String middle command</td><td><pre>StringMid, Temp1, Variable, 2, 3</pre></td><td>0.001565</td></tr><tr class="alt"><td>String trim command</td><td><pre>StringTrimLeft, Temp1, Variable, 1</pre></td><td>0.001494</td></tr><tr><td>String replace command</td><td><pre>StringReplace, Temp1, Variable, c, c, All</pre></td><td>0.001921</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="StringOperations">String Operations</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>String length function</td><td><pre>StrLen(Variable)</pre></td><td>0.001457</td></tr><tr><td>String length command</td><td><pre>StringLen, Temp1, Variable</pre></td><td>0.001506</td></tr><tr class="alt"><td>String split command</td><td><pre>StringSplit, Temp, Variable, c</pre></td><td>0.002056</td></tr><tr><td>Case conversion</td><td><pre>StringUpper, Temp1, Variable</pre></td><td>0.001739</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="Files">Files</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>File attributes and exists function</td><td><pre>FileExist(A_ScriptFullPath)</pre></td><td>0.019902</td></tr><tr><td>If file exists</td><td><pre>IfExist, %A_ScriptFullPath%
Return</pre></td><td>0.018518</td></tr><tr class="alt"><td>Get size</td><td><pre>FileGetSize, Temp1,%A_ScriptFullPath%</pre></td><td>0.027323</td></tr><tr><td>Read file</td><td><pre>FileRead, Temp1, *m100 %A_ScriptFullPath%</pre></td><td>0.040749</td></tr><tr class="alt"><td>Read file line</td><td><pre>FileReadLine, Temp1, %A_ScriptFullPath%, 2</pre></td><td>0.040470</td></tr><tr><td>Append to file</td><td><pre>FileAppend, c, %A_Temp%\Temp.txt</pre></td><td>0.696114</td></tr><tr class="alt"><td>Copy file</td><td><pre>FileCopy, %A_Temp%\Temp.txt, %A_Temp%\Temp1.txt, 1</pre></td><td>0.349373</td></tr><tr><td>Move file</td><td><pre>FileMove, %A_Temp%\Temp.txt, %A_Temp%\Temp.txt, 1</pre></td><td>0.424620</td></tr><tr class="alt"><td>Filesystem loop</td><td><pre>Loop, %A_ScriptFullPath%
Return</pre></td><td>0.027418</td></tr><tr><td>File reading loop</td><td><pre>Loop, Read, %A_ScriptFullPath%
Return</pre></td><td>0.039893</td></tr></tbody></table><p>5,000 iterations each</p><h2 id="ControlFlow">Control Flow</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Normal loop</td><td><pre>Loop, 1
{
}</pre></td><td>0.001963</td></tr><tr><td>While loop</td><td><pre>While, (A_Index = 1)
{
}</pre></td><td>0.002075</td></tr><tr class="alt"><td>Parsing loop</td><td><pre>Loop, Parse, Variable, ,
{
}</pre></td><td>0.002198</td></tr><tr><td>Blank subroutine call</td><td><pre>Gosub, BlankLabel</pre></td><td>0.001995</td></tr><tr class="alt"><td>Blank function call</td><td><pre>BlankFunction()</pre></td><td>0.002097</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="EnvironmentVariables">Environment Variables</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Set environment variable</td><td><pre>EnvSet, EnvVar, abcdeg</pre></td><td>0.004053</td></tr><tr><td>Get environment variable</td><td><pre>EnvGet, Temp1, EnvVar</pre></td><td>0.002245</td></tr></tbody></table><p>500,000 iterations each</p><h2 id="Keyboardandmouse">Keyboard and mouse</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Get mouse position</td><td><pre>MouseGetPos, Temp1, Temp2</pre></td><td>0.002861</td></tr><tr><td>Move mouse</td><td><pre>MouseMove, 0, 0, 0, R</pre></td><td>0.013819</td></tr></tbody></table><p>10,000 iterations each</p><h2 id="DynamicVariables">Dynamic Variables</h2><table><tbody><tr><th>Benchmark</th><th>Code</th><th>Average time per run (ms)</th></tr><tr class="alt"><td>Dynamic variable access</td><td><pre>% %Variable%</pre></td><td>0.002401</td></tr><tr><td>Dynamic variable assignment</td><td><pre>%Variable% = abcdeg</pre></td><td>0.002293</td></tr></tbody></table><p>1,000,000 iterations each</p><h2 id="SystemInformation">System Information</h2><table><tbody><tr><th>Field</th><th>Value</th></tr><tr class="alt"><td>AutoHotkey Version</td><td>AutoHotkey v1.1.06.02 Unicode (x86)</td></tr><tr><td>OS Name</td><td>Microsoft Windows 7 Professional </td></tr><tr class="alt"><td>OS Version</td><td>6.1.7601 Service Pack 1 Build 7601</td></tr><tr><td>OS Configuration</td><td>Standalone Workstation</td></tr><tr class="alt"><td>OS Build Type</td><td>Multiprocessor Free</td></tr><tr><td>System Manufacturer</td><td>Gigabyte Technology Co., Ltd.</td></tr><tr class="alt"><td>System Model</td><td>P55-USB3</td></tr><tr><td>System Type</td><td>x64-based PC</td></tr><tr class="alt"><td>Processor(s)</td><td>1 Processor(s) Installed.,[01]: Intel64 Family 6 Model 30 Stepping 5 GenuineIntel ~2798 Mhz</td></tr><tr><td>BIOS Version</td><td>Award Software International, Inc. F9, 11/1/2010</td></tr><tr class="alt"><td>Total Physical Memory</td><td>16,375 MB</td></tr><tr><td>Available Physical Memory</td><td>12,036 MB</td></tr><tr class="alt"><td>Virtual Memory: Max Size</td><td>40,923 MB</td></tr><tr><td>Virtual Memory: Available</td><td>35,748 MB</td></tr></tbody></table></body></html>
Something went wrong with that request. Please try again.