How to speed up execution
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
How to speed up execution
ahk_h is awesome. The only downside is that the program runs a bit slower. Does anyone have a user who improves this and uses it?
It takes about 2 seconds to execute about 20,000 lines of script.
It takes about 2 seconds to execute about 20,000 lines of script.
Re: How to speed up execution
Do you have an example code that runs slower?
Are you using SetBatchLines, -1
Are you using SetBatchLines, -1
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
Re: How to speed up execution
You would have to take measurements (with QueryPerformanceFrequency / QueryPerformanceCounter) at different places in the code and see where the slowest part is.
I did the same also in a code I used and I found out that the wmi part takes 80% of the speed from my whole code I used (e.g.)
Maybe HotKeyIt implements it (QPC - high-resolution time stamps) in the near future in his ahk_h (als buildin). If not, it is only 3 DllCalls for one measurement.
I did the same also in a code I used and I found out that the wmi part takes 80% of the speed from my whole code I used (e.g.)
Maybe HotKeyIt implements it (QPC - high-resolution time stamps) in the near future in his ahk_h (als buildin). If not, it is only 3 DllCalls for one measurement.
[AHK] v2.0.5 | [WIN] 11 Pro (Version 22H2) | [GitHub] Profile
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
Re: How to speed up execution
jNizM wrote: ↑08 Oct 2021, 04:56You would have to take measurements (with QueryPerformanceFrequency / QueryPerformanceCounter) at different places in the code and see where the slowest part is.
I did the same also in a code I used and I found out that the wmi part takes 80% of the speed from my whole code I used (e.g.)
Maybe HotKeyIt implements it (QPC / Stopwatch) in the near future in his ahk_h. If not, it is only 3 DllCalls for one measurement.
I'm not talking about script performance. It literally means the time when the program is completely loaded when the exe is executed.
ahk_h performance is great.
Re: How to speed up execution
So you mean until your Gui is displayed for example?
In that case try to whitelist the program in your Antivirus programm, because AHK_H is larger and additionally uses compression internally it takes longer to anlyze it.
In that case try to whitelist the program in your Antivirus programm, because AHK_H is larger and additionally uses compression internally it takes longer to anlyze it.
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
Re: How to speed up execution
Yes. But I dont use AV, Windows Defender.
Compile the script with msgbox 1 written 20,000 lines. And when run it takes about 2 sec to show the msgbox window.
I understand that the ahk_h version has to sacrifice some execution time to protect the script.
Re: How to speed up execution
Same is for Windows Defender.
Did you use compression?
Did you use compression?
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
Re: How to speed up execution
That of course takes the time since it copresses additionally line by line.
Did you try to whitelist in Windows Defender, was it any faster afterwards?
Did you try to whitelist in Windows Defender, was it any faster afterwards?
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
Re: How to speed up execution
I already disabled windows defender, so it doesn't seem to matter.
Would the execution speed improve if decrypt 2-3 lines at the same time instead of decrypting line by line? Could this method introduce a security flaw?
Would the execution speed improve if decrypt 2-3 lines at the same time instead of decrypting line by line? Could this method introduce a security flaw?
Re: How to speed up execution
Not much if you have 20.000 lines and yes it would.whynotregister wrote: ↑08 Oct 2021, 09:57Would the execution speed improve if decrypt 2-3 lines at the same time instead of decrypting line by line? Could this method introduce a security flaw?
Re: How to speed up execution
i'm seeing similar results on startup of my compiled script, i think its because of the source code encryption, since it needs to be decrypted on startupwhynotregister wrote: ↑08 Oct 2021, 04:18It takes about 2 seconds to execute about 20,000 lines of script.
-
- Posts: 147
- Joined: 05 Nov 2016, 22:42
Re: How to speed up execution
Yes, thats rightguest3456 wrote: ↑08 Oct 2021, 18:24i'm seeing similar results on startup of my compiled script, i think its because of the source code encryption, since it needs to be decrypted on startupwhynotregister wrote: ↑08 Oct 2021, 04:18It takes about 2 seconds to execute about 20,000 lines of script.