Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Beta version pre-v1.0.48: Up to 3x faster performance


  • Please log in to reply
14 replies to this topic
Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Edit: v1.0.48 has been released, which includes all of the beta features below.

In this version almost all scripts should run faster -- especially scripts that make heavy use of expressions and integer math/comparisons, which may run up to 3x faster. To achieve the full benefit, a script should either avoid using SetFormat (especially "SetFormat Integer"), or use SetFormat's fast mode. This is because the old/slow mode causes some parts of binary-number caching to be disabled for the entire script.

This is a beta release because many low-level changes were made. Although extensively tested, I'd appreciate it if you could try it with your most demanding scripts to ensure a high-quality release.

Performance improvements:[*:33muxak6]Expressions and function calls are compiled more heavily, making them much faster (especially complex integer expressions, including those with commas).
[*:33muxak6]Literal integers in expressions and math/comparison commands are replaced with binary integers, which makes operations involving literal integers faster; e.g. X+5 and "if x > 5".
[*:33muxak6]Binary numbers are cached in variables to avoid conversions to/from strings. This makes numerical operations involving variables much faster. For example, passing an address to DllCall such as DllCall(VarContainingAddress) is up to 2x faster. However, taking the address of a variable (e.g. &var) permanently marks that variable as uncacheable because it allows the user to read/write its contents in unconventional ways.
[*:33muxak6]LOOPs, IFs, and ELSEs that have blocks (braces) are faster due to skipping the opening '{'. A side-effect is that the '{' is omitted from ListLines.
[*:33muxak6]The speed of thread creation has been improved, which should help rapid-fire threads in OnMessage(), RegisterCallback(), and GUI events.Changes that might affect existing scripts:[*:33muxak6]Floating point numbers stored in variables have higher precision; scripts that rely on tiny differences in precision might need updating. Alternatively, using "SetFormat Float" anywhere in the script (e.g. SetFormat, Float, 0.6) disables caching of floating point numbers, which should improve compatibility.
[*:33muxak6]When SetFormat, Integer, Hex is in effect, assigning a literal decimal integer to a variable also converts it to hex. Usually this is only a display issue.
[*:33muxak6]OnMessage(): For performance, the message number and HWND arrive as standard numbers rather than appearing unconditionally as hex. Usually this is only a display issue.
[*:33muxak6]LowLevel & dynamic code doesn't yet work with this version.
[*:33muxak6]In this version, scripts use slightly more memory (proportionate to the number of variables and expressions).Here is the new AutoHotkey.exe. If you wish, you can rename or move your original AutoHotkey.exe and put this one in its place: <!-- w -->www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-new4.exe<!-- w --> (238 KB)

For those who would like to compile scripts with this release, unzip the following file in your \Program Files\AutoHotkey\Compiler folder:
<!-- w -->www.autohotkey.com/misc/AutoHotkey-Pre- ... N-new4.zip<!-- w --> (240 KB)

Please let me know if you find any problems with it.

Soon I'll try to catch up on the bug reports and wish list forums. I'll also try to include some of Lexikos' changes.

Edit #1: Skan discovered that a command with zero parameters such as "Critical" can prevent a Loop, Exit, or ExitApp beneath it from receiving the correct first parameter. This has been fixed, and the link above now points to the corrected version.

Edit #2: Thanks to Icarus, the release has been fixed so that date-math with EnvSub (-=) works when the second parameter is a variable. The link above points to the corrected version.

Edit #3: LowLevel & dynamic code doesn't yet work with this beta version.

Edit #4: For those who would like to compile scripts with this release, there is now an SC/BIN file above for download.

Edit #5: The compiler/BIN file link above has been fixed on 12/30/2008 so that the /NoDecompile switch works.

Edit #6: Thanks to Lexikos, the release has been fixed so that bitwise operations involving floating point variables don't wrongly cache those variables as integers. The links above point to the corrected version.

Edit #7: Fixed the BIN/compiler ZIP file to contain the new version instead of the old one.

Edit #8: The compiler/BIN file link above has been fixed on 2/1/2009 so that SetFormat disables the caching of binary numbers in variables. This makes compiled scripts behave the same as non-compiled scripts.

Edit #9: There is a new beta version. It improves the speed of thread creation and fixes all the bugs in the Bug Reports forum that were readily fixable. The download links higher above point to the updated version.

Edit #10: I updated the files linked above without changing the filename/URL/version. There was a slight chance that a thread could become permanently uninterruptible if the PC was suspended/hibernated for more than 24 days (this is due to the 32-bit nature of GetTickCount()). This has been corrected.

Edit #11: On 2/19/2009 I updated the files linked above without changing the filename/URL/version. NumPut() has been improved to support UInt64 like DllCall() does. [thanks Sean]

Edit #12: Somewhere along the way, the SetFormat command was enhanced with a "fast mode" that avoids disabling the caching of binary numbers. For more details, see <!-- w -->www.autohotkey.com/docs/commands/SetFormat.htm#Fast<!-- w -->

Edit #13: On 2/20/2009 I updated the SC/bin file linked above without changing the filename/URL/version. The /NoDecompile option has been fixed (thanks pekkle).

Edit #14: 2/21/2009: I updated the files linked above without changing the filename/URL/version. Since backward compatibility is important, the following behaviors have been changed back to the way they were in non-beta versions:
func(0xFF)  ; The called function will now receive hexadecimal format rather than decimal.
x := 1, y := 0xFF  ; Assignments that occur inside pure expressions now retain hexadecimal formatting (isolated assignments like y:=0xFF always did this)
Since there is little performance impact to keep this backward compatibility, it seemed best to do so. It also makes hexadecimal behavior more consistent.

SKAN
  • Administrators
  • 9115 posts
  • Last active:
  • Joined: 26 Dec 2005
Great! Thanks Mr.Chris :)

Icarus
  • Members
  • 851 posts
  • Last active: Jan 02 2012 11:17 AM
  • Joined: 24 Nov 2005
Thanks Chris.
Will test with the more demanding scripts, and report back on issues.
Sector-Seven - Freeware tools built with AutoHotkey

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
Skan found one issue: a command with zero parameters such as "Critical" can prevent a Loop, Exit, or ExitApp beneath it from receiving the correct first parameter. This has been fixed, the link above now points to the corrected version.

Icarus
  • Members
  • 851 posts
  • Last active: Jan 02 2012 11:17 AM
  • Joined: 24 Nov 2005
Another possible issue:
; This gives a different result in the new version
; (always 0)
FileGetTime FileTime, C:\Windows\Winhelp.exe
FileAge := A_Now
EnvSub FileAge, %FileTime%, minutes
msgbox %fileage%

Sector-Seven - Freeware tools built with AutoHotkey

Chris
  • Administrators
  • 10727 posts
  • Last active:
  • Joined: 02 Mar 2004
The release has been fixed so that date-math with EnvSub (-=) works when the second parameter is a variable. The link in the top post points to the corrected version.

Thanks for the fast testing.

corrupt
  • Members
  • 2558 posts
  • Last active: Nov 01 2014 03:23 PM
  • Joined: 29 Dec 2004
Thanks for the Beta release :!: :D . I'll take it for a spin... :D

Pil
  • Members
  • 55 posts
  • Last active: Mar 25 2014 05:00 AM
  • Joined: 26 Feb 2006
Yes,,,Thank you sir...
All my scripts runs lot faster.
What´s better; the DllCall´s in my scripts are also almost three times faster.
Long live AHK

Krogdor
  • Members
  • 1391 posts
  • Last active: Jun 08 2011 05:31 AM
  • Joined: 18 Apr 2008
Wonderful! Although for now Lexikos' release has more benefits for me, since I usually don't use many high-demand scripts, I'm very glad to see that you haven't given up on the AHK project!

Thanks for your hard work, Chris.

Laszlo
  • Moderators
  • 4713 posts
  • Last active: Mar 31 2012 03:17 AM
  • Joined: 14 Feb 2005
Tried with all of my time critical scripts, even with a 10K line real time musical instrument controller, without any problems, and with noticeable speedup. Thanks!

IsNull
  • Moderators
  • 990 posts
  • Last active: May 15 2014 11:56 AM
  • Joined: 10 May 2007
I'm happy to hear such good news from you. The performance improvement is realy nice. :)

But, there is a big Question;

We have now Lexicos working on AHK_L, Titan comes up with IronAHK, and there are some rumor's of a Version 2 from AHK. So, I'm a bit confused about the new developments. Why not working together for one, big AHK? What's the status quo?

Maby u can give us/me a hint what comes next :D

regards
IsNull

Icarus
  • Members
  • 851 posts
  • Last active: Jan 02 2012 11:17 AM
  • Joined: 24 Nov 2005

But, there is a big Question;


Not to try and answer instead of Chris, and not to undermine what Lexikos, Titan and others are doing, but the answer should be obvious.
The official AutoHotkey release is made by Chris.
There are a few talented people in this community doing addons and/or alternative distributions with different features.

You may choose to use the official release by Chris, or any other distribution by the others.

If I am reading the situation as it is, some of the features implemented in the alternative releases, may be embedded in the official release by Chris, and some may not.
Sector-Seven - Freeware tools built with AutoHotkey

SoggyDog
  • Members
  • 803 posts
  • Last active: Mar 04 2013 06:27 AM
  • Joined: 02 May 2006
Thanks, Chris.

I've missed hearing from you.

Klaus, nli
  • Guests
  • Last active:
  • Joined: --
Thanks for being back again, Chris,
great things to come,
Klaus

jordis
  • Members
  • 81 posts
  • Last active: Aug 22 2014 01:56 PM
  • Joined: 30 Jul 2004
respect!
I'm going to test my scripts as soon as I can.
Looking forward to the speed boost!