AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compiler Speed - Which AHK2EXE is the fastest for me?
Goto page 1, 2  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions
View previous topic :: View next topic  
Author Message
Zed Gecko



Joined: 23 Sep 2006
Posts: 98

PostPosted: Thu Aug 02, 2007 4:38 pm    Post subject: Compiler Speed - Which AHK2EXE is the fastest for me? Reply with quote

In the "Ask for Help" section we found out that faster Computers may not neccessary compile AHK-code faster.

We found the same script to be compiled on a
700Mhz-P3-256MB-Computer in 2163 milliseconds and on a
2GHz-P4-512MB-Computer in 11750 milliseconds.
Chris said:
Quote:
If a short script takes longer than expected (more than 5 seconds on an ultrafast CPU), it might be because the code is currently optimized to be small in size. It's also optimized for a mixture of old and new CPUs (Pentium and Pentium 2/3/4+).

Therfore Chris was so kind to provide us with 2 more compilers:
(removed, obsolete)

I made this little script to easily test the performance of the different compilers:
Code:
StringTrimRight, OutputVar, A_AhkPath, 14
IfNotExist, %Outputvar%Compiler\Ahk2Exe-FavorFastCode.exe
{
    MsgBox, Ahk2Exe-FavorFastCode.exe does not exist in the "compiler"-folder of AHK.`n  Download at http://www.autohotkey.com/misc/Ahk2Exe-FavorFastCode.zip
   ExitApp
}   

IfNotExist, %Outputvar%Compiler\Ahk2Exe-FavorFastCode-Pentium4orHigher.exe
{
    MsgBox, Ahk2Exe-FavorFastCode-Pentium4orHigher.exe does not exist in the "compiler"-folder of AHK.`n  Download at http://www.autohotkey.com/misc/Ahk2Exe-FavorFastCode.zip
   ExitApp
}   

FileSelectFile, ScriptName, 3, , Select a file to compile, AHK-Script (*.ahk)
if ScriptName =
    ExitApp
SplitPath, ScriptName , , , , OutNameNoExt

Gui, Add, Edit, r9 w500 vMyEdit
Gui, Show, , Compiler Timing


IfExist, %Outputvar%Compiler\upx.exe

   StartTime := A_TickCount
   RunWait, %Outputvar%Compiler\Ahk2exe.exe /in "%ScriptName%" /out "SC_UPX_%OutNameNoExt%.exe"
   SC_UPX_ElapsedTime := A_TickCount - StartTime
   Result := Result . "Time for standard compiler with UPX (in ms): " . SC_UPX_ElapsedTime . "`n"
   GuiControl, , MyEdit , %Result%
   sleep, 1000
   
   StartTime := A_TickCount
   RunWait, %Outputvar%Compiler\Ahk2Exe-FavorFastCode.exe /in "%ScriptName%" /out "FFC_UPX_%OutNameNoExt%.exe"
   FFC_UPX_ElapsedTime := A_TickCount - StartTime
   Result := Result . "Time for FavorFast compiler with UPX (in ms): " . FFC_UPX_ElapsedTime . "`n"
   GuiControl, , MyEdit , %Result%
   sleep, 1000
   
   StartTime := A_TickCount
   RunWait, %Outputvar%Compiler\Ahk2Exe-FavorFastCode-Pentium4orHigher.exe /in "%ScriptName%" /out "FFP4HC_UPX_%OutNameNoExt%.exe"
   FFP4HC_UPX_ElapsedTime := A_TickCount - StartTime
   Result := Result . "Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): " . FFP4HC_UPX_ElapsedTime . "`n"
   GuiControl, , MyEdit , %Result%
}
else
Result := "No upx.exe found. Only compiling without."

FileMove, %Outputvar%Compiler\upx.exe, %Outputvar%Compiler\upx.dis 
sleep, 2000

StartTime := A_TickCount
RunWait, %Outputvar%Compiler\Ahk2exe.exe /in "%ScriptName%" /out "SC_NoUPX_%OutNameNoExt%.exe"
SC_NoUPX_ElapsedTime := A_TickCount - StartTime
Result := Result . "Time for standard compiler without UPX (in ms): " . SC_NoUPX_ElapsedTime . "`n"
GuiControl, , MyEdit , %Result%
sleep, 1000

StartTime := A_TickCount
RunWait, %Outputvar%Compiler\Ahk2Exe-FavorFastCode.exe /in "%ScriptName%" /out "FFC_NoUPX_%OutNameNoExt%.exe"
FFC_NoUPX_ElapsedTime := A_TickCount - StartTime
Result := Result . "Time for FavorFast compiler without UPX (in ms): " . FFC_NoUPX_ElapsedTime . "`n"
GuiControl, , MyEdit , %Result%
sleep, 1000

StartTime := A_TickCount
RunWait, %Outputvar%Compiler\Ahk2Exe-FavorFastCode-Pentium4orHigher.exe /in "%ScriptName%" /out "FFP4HC_NoUPX_%OutNameNoExt%.exe"
FFP4HC_NoUPX_ElapsedTime := A_TickCount - StartTime
Result := Result . "Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): " . FFP4HC_NoUPX_ElapsedTime . "`n"
GuiControl, , MyEdit , %Result%
sleep, 1000

FileMove, %Outputvar%Compiler\upx.dis, %Outputvar%Compiler\upx.exe
return

GuiClose:
ExitApp

You need to copy the two new compilers in the compiler-folder of ahk, to make the script work. Then you´re ready to choose your weapon of choice Wink


I have compiled the following test-script on my Computer (700Mhz-P3 256MB) to give you a reference:
Code:
Target = www.google.de
Run, cmd /c tracert %Target% > MyPing.txt
FileRead, FileContent, MyPing.txt
run , MyPing.txt

Quote:
Time for standard compiler with UPX (in ms): 2674
Time for FavorFast compiler with UPX (in ms): 2283
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 2313
Time for standard compiler without UPX (in ms): 741
Time for FavorFast compiler without UPX (in ms): 701
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 661

Please post your result for compiling the above script, too.
Back to top
View user's profile Send private message
Superfraggle



Joined: 02 Nov 2004
Posts: 901
Location: London, UK

PostPosted: Thu Aug 02, 2007 4:48 pm    Post subject: Reply with quote

Compiling the same test script produced

Quote:
Time for standard compiler with UPX (in ms): 1110
Time for FavorFast compiler with UPX (in ms): 890
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 891
Time for standard compiler without UPX (in ms): 359
Time for FavorFast compiler without UPX (in ms): 344
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 344


This was an intel core 2 running at 2 gig
_________________
Steve F AKA Superfraggle

http://r.yuwie.com/superfraggle
Back to top
View user's profile Send private message MSN Messenger
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Thu Aug 02, 2007 5:09 pm    Post subject: Reply with quote

P4 2.26GHz 256MB memory

Quote:

Time for standard compiler with UPX (in ms): 1583
Time for FavorFast compiler with UPX (in ms): 1212
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 1282
Time for standard compiler without UPX (in ms): 381
Time for FavorFast compiler without UPX (in ms): 360
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 411

_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Jon



Joined: 28 Apr 2004
Posts: 373

PostPosted: Fri Aug 03, 2007 4:08 pm    Post subject: Reply with quote

It must require the latest version of Autohotkey because I couldn't get it to work properly at first. (it would only give the first result)

Code:
Time for standard compiler with UPX (in ms): 3734
Time for FavorFast compiler with UPX (in ms): 3563
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 3484
Time for standard compiler without UPX (in ms): 515
Time for FavorFast compiler without UPX (in ms): 438
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 453


AMD Sempron 2600+

1gb memory
Back to top
View user's profile Send private message Send e-mail
§~Infinity~§®



Joined: 29 Mar 2007
Posts: 12
Location: Damascus, Syria

PostPosted: Fri Aug 03, 2007 6:02 pm    Post subject: Reply with quote

Here is my result:

Code:
Time for standard compiler with UPX (in ms): 3515
Time for FavorFast compiler with UPX (in ms): 1594
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 1219
Time for standard compiler without UPX (in ms): 1422
Time for FavorFast compiler without UPX (in ms): 1281
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 1422


Pentium 4 3.0Ghz
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
Lexikos



Joined: 17 Oct 2006
Posts: 2589
Location: Australia, Qld

PostPosted: Sun Aug 05, 2007 4:18 am    Post subject: Reply with quote

Very strange how much variance you guys are getting... My results were:
Quote:
Time for standard compiler with UPX (in ms): 1328
Time for FavorFast compiler with UPX (in ms): 1078
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 1016
Time for standard compiler without UPX (in ms): 859
Time for FavorFast compiler without UPX (in ms): 1000
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 1047
They all seem fairly much the same. Confused

Athlon XP 3000+
1 GB RAM
Vista

Edit: Looks like Vista's caching something. I ran the test again, on a much larger (~600 lines vs 4 lines) script, and all the results were in the 950-1050 ms range. Looking closer at your results, the difference seems to be in UPX/no UPX. Strange that UPX makes very little difference to mine...

How big should the resulting exes for that 4-line test script be?

Edit2: Err.. there's no size difference between the UPX/no UPX exes. Sad

Edit3: Okay, this is weird. I tried manually compressing the .exes with upx, and it fails because they're "already packed by UPX" - even the "without UPX" exes!

They're all 196 KB.
Back to top
View user's profile Send private message
Z Gecko
Guest





PostPosted: Sun Aug 05, 2007 3:15 pm    Post subject: Reply with quote

This is indeed weird,
on my machine the upx-compressed testfiles are 196KB and the non-compressed are 399KB.
Back to top
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Sun Aug 05, 2007 4:48 pm    Post subject: Reply with quote

Z Gecko wrote:
This is indeed weird,
on my machine the upx-compressed testfiles are 196KB and the non-compressed are 399KB.

mine were the same on my XP computer at work. I will try my home Vista machine.

Edit:
I get some funny error about it not being able to find "C:\iLib", but only on the special AHK2Exe files.

Edit2:
Once I created the file (empty), I was able to get this
Quote:

Time for standard compiler with UPX (in ms): 1997
Time for FavorFast compiler with UPX (in ms): 1747
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 1872
Time for standard compiler without UPX (in ms): 1825
Time for FavorFast compiler without UPX (in ms): 1794
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 1934


AMD Turion 64bit dual core with 2GB ram on Vista (32 bit). Tested in battery saver mode (0.8Ghz)

At full speed (1.8GHz), I get:
Quote:

Time for standard compiler with UPX (in ms): 842
Time for FavorFast compiler with UPX (in ms): 827
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 904
Time for standard compiler without UPX (in ms): 827
Time for FavorFast compiler without UPX (in ms): 890
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 874

_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
daonlyfreez



Joined: 16 Mar 2005
Posts: 745
Location: Berlin

PostPosted: Sun Aug 05, 2007 5:42 pm    Post subject: Reply with quote

Quote:
Time for standard compiler with UPX (in ms): 4891
Time for FavorFast compiler with UPX (in ms): 4578
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 4516
Time for standard compiler without UPX (in ms): 2578
Time for FavorFast compiler without UPX (in ms): 2609
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 2625


Athlon XP 2800+
512 MB RAM
Win2k
_________________
(sorry, homesite offline atm)
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger MSN Messenger
ahklerner



Joined: 26 Jun 2006
Posts: 1219
Location: USA

PostPosted: Sun Aug 05, 2007 7:50 pm    Post subject: Reply with quote

Quote:
Time for standard compiler with UPX (in ms): 3671
Time for FavorFast compiler with UPX (in ms): 3625
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 3672
Time for standard compiler without UPX (in ms): 515
Time for FavorFast compiler without UPX (in ms): 500
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 547


OS Name Microsoft Windows XP Professional
Version 5.1.2600 Service Pack 2 Build 2600
System Type X86-based PC
Processor x86 Family 6 Model 14 Stepping 12 GenuineIntel ~1828 Mhz
Processor x86 Family 6 Model 14 Stepping 12 GenuineIntel ~1828 Mhz
Total Physical Memory 2,048.00 MB

(Dual Core)

Was not on AC Power.


Same Machine On AC Power
Quote:
Time for standard compiler with UPX (in ms): 2031
Time for FavorFast compiler with UPX (in ms): 2110
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 1984
Time for standard compiler without UPX (in ms): 375
Time for FavorFast compiler without UPX (in ms): 391
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 390


Last edited by ahklerner on Sun Aug 05, 2007 8:46 pm; edited 1 time in total
Back to top
View user's profile Send private message
SKAN



Joined: 26 Dec 2005
Posts: 6063

PostPosted: Sun Aug 05, 2007 8:32 pm    Post subject: Reply with quote

Quote:
Time for standard compiler with UPX (in ms): 1344
Time for FavorFast compiler with UPX (in ms): 1094
Time for FavorFast-Pentium4orHigher compiler with UPX (in ms): 1219
Time for standard compiler without UPX (in ms): 453
Time for FavorFast compiler without UPX (in ms): 390
Time for FavorFast-Pentium4orHigher compiler without UPX (in ms): 422


AMD Sempron 1.4Ghz / 256MB Ram / Win XP SP2

Smile
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2419

PostPosted: Mon Aug 06, 2007 8:12 pm    Post subject: Reply with quote

Interesting... Out of curiousity, what's the purpose of trying to speed up the compiling process (which isn't really "compiling" per se...) ?
Back to top
View user's profile Send private message Visit poster's website
engunneer



Joined: 30 Aug 2005
Posts: 6804
Location: Pacific Northwest, US

PostPosted: Mon Aug 06, 2007 10:10 pm    Post subject: Reply with quote

mostly this was a test since it was REALLY slow on someone's PC.
_________________
Unless otherwise noted, all code is untested.
Common Answers: 1.(Loops, Viruses, etc.) 2. Search 3.RTFM
Back to top
View user's profile Send private message Visit poster's website
Z Gecko
Guest





PostPosted: Mon Aug 06, 2007 10:15 pm    Post subject: Reply with quote

Well, it started in the help-section where someone complained about the long "compiling"-time.
As far as I know, there is (or better was) no hint in the documentation or the forum how long it normaly takes to "compile" a script.
So i made the script, to give kind of a reference on how long it takes.
The rest was pure curiosity Embarassed
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10467

PostPosted: Mon Aug 06, 2007 11:17 pm    Post subject: Reply with quote

Thanks for the results. I'll put the favor-fast-code optimization into effect in the next release because it's slightly faster for most people, and (ironically) smaller in code size than the original favor-small-code version.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Scripts & Functions All times are GMT
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group