Improve script speed. Removing default delays.

Get help with using AutoHotkey and its commands and hotkeys
User avatar
alvitawa
Posts: 71
Joined: 20 Jan 2014, 09:46

Improve script speed. Removing default delays.

09 Feb 2014, 15:24

I found these delays:

Code: Select all

SetControlDelay, -1
SetWinDelay, -1
SetMouseDelay, -1
SetKeyDelay, -1
Wich I can set to -1 to improve script speed, but are there any more default delays? And other ways to improve script speed?
User avatar
trismarck
Posts: 506
Joined: 30 Sep 2013, 01:48
Location: Poland

Re: Improve script speed. Removing default delays.

09 Feb 2014, 15:50

Please see this thread. The main command that improves the speed is SetBatchLines, -1.

In general, besides minimizing delays, one would tweak the source code directly (by i.e. using expressions whenever possible) to speed things up. If there are two lines of code that perform the same action, those could be profiled to see, which one is faster. Perhaps if you posted the code that needs speed improvement, someone could tweak it / see why the code is slow.

HTH.
User avatar
alvitawa
Posts: 71
Joined: 20 Jan 2014, 09:46

Re: Improve script speed. Removing default delays.

09 Feb 2014, 16:01

trismarck wrote:Please see this thread. The main command that improves the speed is SetBatchLines, -1.

In general, besides minimizing delays, one would tweak the source code directly (by i.e. using expressions whenever possible) to speed things up. If there are two lines of code that perform the same action, those could be profiled to see, which one is faster. Perhaps if you posted the code that needs speed improvement, someone could tweak it / see why the code is slow.

HTH.
It's not that my script needs to be faster(it works fairly fast). I'm just gathering some methods to improve it's speed. Thx for the tips! :)
RHCP
Posts: 196
Joined: 30 Sep 2013, 10:59

Re: Improve script speed. Removing default delays.

12 Feb 2014, 23:27

Code: Select all

ListLines Off
This will marginally improve performance.

Code: Select all

#KeyHistory 0
Disabling the key history might help as well. But it would be very minor.

And of course use

Code: Select all

#NoEnv
User avatar
MasterFocus
Posts: 146
Joined: 01 Oct 2013, 09:47
GitHub: MasterFocus
Location: Rio de Janeiro - RJ - Brasil
Contact:

Re: Improve script speed. Removing default delays.

13 Feb 2014, 00:22

In addition to SetBatchLines, -1, #NoEnv, #KeyHistory 0 and ListLines, Off already mentioned,
you can also use Process, Priority,, High to let the script's process have a high CPU priority.
Antonio França - git.io | github.com | ahk4.net | sites.google.com
Member of the AHK community since 08/Apr/2009. Moderator since mid-2012.
Need help? Please post on the forum before sending me a PM.
User avatar
alvitawa
Posts: 71
Joined: 20 Jan 2014, 09:46

Re: Improve script speed. Removing default delays.

13 Feb 2014, 01:39

RHCP wrote:

Code: Select all

ListLines Off
This will marginally improve performance.

Code: Select all

#KeyHistory 0
Disabling the key history might help as well. But it would be very minor.

And of course use

Code: Select all

#NoEnv
MasterFocus wrote:In addition to SetBatchLines, -1, #NoEnv, #KeyHistory 0 and ListLines, Off already mentioned,
you can also use Process, Priority,, High to let the script's process have a high CPU priority.
Will ListLines Off and KeyHistory also improve reilability on compiled scripts?

Thanks :)

Return to “Ask For Help”

Who is online

Users browsing this forum: DanRim, k0rey777, maestrith, Mordolohoco, Reniazas, sebbulon, w0z and 56 guests