Page 1 of 1

Slower reload after upgrade

Posted: 07 Apr 2018, 05:29
by think
Hi, after upgrading from 1.22 to 1.28, reloading one of my larger scripts is now much slower. First run is instant, however reloading (or running again) the same script causes a two seconds delay (windows waiting cursor, slow cursor movement). After the script is reloaded it shows two Tray icons, when cursor is moved over Tray, the second icon disappears.

It looks like closing of processes takes much more time now... Any idea?

Re: Slower reload after upgrade

Posted: 15 Jun 2018, 16:59
by think
Installed 1.1.29.01 and the issue is the same.

Re: Slower reload after upgrade

Posted: 15 Jun 2018, 19:28
by swagfag
i doubt anyones gonna be able to tell you much without seeing the contents of the script

Re: Slower reload after upgrade

Posted: 15 Jun 2018, 19:31
by jeeswg
Try 1.1.23/24/25/26/27 to help narrow it down.

Re: Slower reload after upgrade

Posted: 16 Jun 2018, 05:18
by think
Thanks for the tip! The script is large and consists of several threads, using multiple ahkthread, ahkterminate etc.

I tried all the releases and I have found the following (both AutoHotkey_H Unicode 32-bit):
1.1.24.05 H008 - WORKS
1.1.25.00 H001 - HAVE ISSUES

The following issues started from 1.1.25.00 H001 onwards:
- slower script exit/reload, two seconds delay with slow cursor movement.
- two tray icons after reload, the older disappears when cursor is moved over it.
- one of the dll.ahkTerminate() functions crashes the script (AutoHotkey has stopped working).

What was changed in 1.1.25.00 H001 that could cause the above issues?

Re: Slower reload after upgrade

Posted: 16 Jun 2018, 09:40
by HotKeyIt
As far as I remember there was a bug reloading a thread and resources were not freed fully, after the fix it might take longer to reload.
With regards to crashes and slow mouse movements it would be good if you can post an example script.

Re: Slower reload after upgrade

Posted: 18 Jun 2018, 03:13
by think
Thanks for your response HotKeyIt. I believe I have found a reason - the following simple script crashes on exit or reload. The reason is in #IfWinExistcommand.
As mentioned this started with 1.1.25.00 H001.

Code: Select all

string:="
(
#NoTrayIcon
#IfWinExist Untitled - Notepad    ;<--- this causes the issue
::kr::kind regards
)"
dll:=ahkthread(string)
Return

Re: Slower reload after upgrade

Posted: 18 Jun 2018, 16:48
by HotKeyIt
This is because your main script exits right away, you have to use #Persistent!

Re: Slower reload after upgrade

Posted: 19 Jun 2018, 02:32
by think
No difference, please run the script and try to exit or reload it.

Code: Select all

#Persistent
string:="
(
#NoTrayIcon
#IfWinExist Untitled - Notepad    ;<--- this causes the issue
::kr::kind regards
)"
dll:=ahkthread(string)
Return

Re: Slower reload after upgrade

Posted: 19 Jun 2018, 16:47
by HotKeyIt
Many thanks, this has been fixed now: https://github.com/HotKeyIt/ahkdll-v1-r ... master.zip

Re: Slower reload after upgrade

Posted: 20 Jun 2018, 04:37
by think
Thanks! ;)