 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10666
|
Posted: Fri Nov 21, 2008 8:37 pm Post subject: Beta version pre-v1.0.48: Up to 3x faster performance |
|
|
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:- Expressions and function calls are compiled more heavily, making them much faster (especially complex integer expressions, including those with commas).
- 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".
- 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.
- 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.
- 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:- 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.
- 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.
- 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.
- LowLevel & dynamic code doesn't yet work with this version.
- 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: www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-new4.exe (238 KB)
For those who would like to compile scripts with this release, unzip the following file in your \Program Files\AutoHotkey\Compiler folder:
www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-BIN-new4.zip (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 www.autohotkey.com/docs/commands/SetFormat.htm#Fast
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: | Code: | 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.
Last edited by Chris on Fri Mar 20, 2009 8:39 pm; edited 25 times in total |
|
| Back to top |
|
 |
SKAN
Joined: 26 Dec 2005 Posts: 7753
|
Posted: Fri Nov 21, 2008 10:06 pm Post subject: |
|
|
Great! Thanks Mr.Chris  |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 832
|
Posted: Fri Nov 21, 2008 11:08 pm Post subject: |
|
|
Thanks Chris.
Will test with the more demanding scripts, and report back on issues. _________________ Sector-Seven - Freeware tools built with AutoHotkey |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10666
|
Posted: Fri Nov 21, 2008 11:09 pm Post subject: |
|
|
| 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. |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 832
|
Posted: Fri Nov 21, 2008 11:25 pm Post subject: EnvSub issue |
|
|
Another possible issue:
| Code: |
; 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 |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10666
|
Posted: Sat Nov 22, 2008 12:20 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
corrupt
Joined: 29 Dec 2004 Posts: 2460
|
Posted: Sat Nov 22, 2008 4:14 pm Post subject: |
|
|
Thanks for the Beta release . I'll take it for a spin...  |
|
| Back to top |
|
 |
Pil
Joined: 26 Feb 2006 Posts: 55 Location: Recife Brazil
|
Posted: Sun Nov 23, 2008 1:00 am Post subject: |
|
|
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 |
|
| Back to top |
|
 |
Krogdor
Joined: 18 Apr 2008 Posts: 1390 Location: The Interwebs
|
Posted: Sun Nov 23, 2008 2:30 am Post subject: |
|
|
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. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4683 Location: Boulder, CO
|
Posted: Sun Nov 23, 2008 2:56 am Post subject: |
|
|
| 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! |
|
| Back to top |
|
 |
IsNull
Joined: 10 May 2007 Posts: 329 Location: .switzerland
|
Posted: Sun Nov 23, 2008 3:01 pm Post subject: |
|
|
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
regards
IsNull _________________ http://securityvision.ch
AHK 2D GAME ENGINE |
|
| Back to top |
|
 |
Icarus
Joined: 24 Nov 2005 Posts: 832
|
Posted: Sun Nov 23, 2008 3:09 pm Post subject: |
|
|
| IsNull wrote: | | 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 |
|
| Back to top |
|
 |
SoggyDog
Joined: 02 May 2006 Posts: 656 Location: Greeley, CO
|
|
| Back to top |
|
 |
Klaus, nli Guest
|
Posted: Sun Nov 23, 2008 7:48 pm Post subject: |
|
|
Thanks for being back again, Chris,
great things to come,
Klaus |
|
| Back to top |
|
 |
jordis
Joined: 30 Jul 2004 Posts: 80
|
Posted: Sun Nov 23, 2008 9:12 pm Post subject: |
|
|
respect!
I'm going to test my scripts as soon as I can.
Looking forward to the speed boost! |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|