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.
Get help with using AutoHotkey and its commands and hotkeys
3 posts • Page 1 of 1
Not as far as I'm aware.Is there any overhead and extra resource usage in the EXE version?
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.