AHK vs converted EXE

Get help with using AutoHotkey and its commands and hotkeys
omar
Posts: 295
Joined: 22 Oct 2015, 17:56

AHK vs converted EXE

24 May 2018, 08:17

If I run some code just as an AHK script vs an AHK script converted to EXE...

Is there any overhead and extra resource usage in the EXE version?

The code needs to be always running.

Thanks.
omar
Posts: 295
Joined: 22 Oct 2015, 17:56

Re: AHK vs converted EXE

27 Jun 2018, 18:58

anyone?
thanks
coffee
Posts: 65
Joined: 01 Apr 2017, 07:55

Re: AHK vs converted EXE

27 Jun 2018, 19:32

Is there any overhead and extra resource usage in the EXE version?

Not as far as I'm aware.

Scripts are not "converted to exe" when "compiling" with Ahk2Exe. (there's no byte code or machine code generated).
The script file (.ahk) is simply embedded in the EXE as a resource (it always continues to be a separate script file). Then the exe reads this resource at runtime (instead of a .ahk file in the filesystem).
Ahk2Exe cleans up comments and blank lines. It also joins all the explicit and automatic includes onto the script and generates a single ahk file and this single ahk file is the one that is attached to the AutoHotkeySC.bin.
If anything, in theory, the final joined script file produced by Ahk2Exe is "faster" to launch than an unjoined script in the file system, although you will probably be never able to tell.

"AutoHotkeySC.bin" is just a slighlty trimmed version of AutoHotkey.exe, that automatically assumes and has some stuff disabled (e.g it doesnt have the #include mechanic since it assumes Ahk2Exe joined everything).

Compiled or not, in the file system or as a resource, Autohotkey will always have to interpret the script every time it launches.
The only extra resource usage i can think of will come from each "compiled" script having its own interpreter in the file system (AutoHotkeySC.bin+script). Instead of being one Autohotkey.exe in the drive to launch all scripts. But considering hard drive and ssd capacities nowadays, I don't think it matters even if you had 10,000 compiled scripts in the hard drive.

Return to “Ask For Help”

Who is online

Users browsing this forum: Google [Bot], kvich, scriptors and 91 guests