 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Sun Feb 01, 2009 1:18 pm Post subject: |
|
|
Thanks for the report and the location of the problem.
The compiler/BIN file has been fixed so that SetFormat disables the caching of binary numbers in variables. This makes compiled scripts behave the same as non-compiled scripts.
To use the new version, unzip the following file in your \Program Files\AutoHotkey\Compiler folder:
www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-BIN-new3.zip (240 KB) |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Sun Feb 01, 2009 11:22 pm Post subject: |
|
|
| With this AutoHotkeySC.bin the exe file is twice larger than before (420KB instead of 210KB). Do I need to do something to enable compression? |
|
| Back to top |
|
 |
tank
Joined: 21 Dec 2007 Posts: 3700 Location: Louisville KY USA
|
Posted: Mon Feb 02, 2009 4:51 pm Post subject: |
|
|
http://www.autohotkey.com/forum/viewtopic.php?p=247351#247351
seems the problem i describe here happens in the non compiled script with the beta _________________
We are troubled on every side‚ yet not distressed; we are perplexed‚
but not in despair; Persecuted‚ but not forsaken; cast down‚ but not destroyed; |
|
| Back to top |
|
 |
Colorize Guest
|
Posted: Fri Feb 06, 2009 2:37 am Post subject: Darn Green Line! |
|
|
I just wanted to report a bug. It seems that in the following code, two weird greenish lines appear for some unknown reason. The bug occurs only when using the beta EXE and BIN.
The code:
| Code: | #SingleInstance,Force
OnExit, GuiClose
Range1 := RGBRange(0xFFFFFF, 0xF00000, -100, "`n")
Range2 := RGBRange(0xF00000, 0x000000, -100, "`n")
Gui, Font,s36 w1000000
Loop,Parse,Range1,`n
{
Gui,Add,Text,yp+1 x50 BackgroundTrans c%A_LoopField%, _
}
Loop,Parse,Range2,`n
{
Gui,Add,Text,yp+1 x50 BackgroundTrans c%A_LoopField%, _
}
Gui, Show,, A
Return
RGBRange(x, y=0, c=0, delim=",")
{
oif := A_FormatInteger
SetFormat, Integer, H
dr:=(y>>16&255)-(r:=x>>16&255)
dg:=(y>>8&255)-(g:=x>>8&255)
db:=(y&255)-(b:=x&255)
d := sqrt(dr**2 + dg**2 + db**2)
v := Floor(d/c)
IfLessOrEqual, c, 0, SetEnv, c, % d/( v := c<-3 ? -1-Ceil(c) : 2 )
s := c/d
cr:=sqrt(d**2-dg**2-db**2)*s*((dr>0)*2-1)
cg:=sqrt(d**2-dr**2-db**2)*s*((dg>0)*2-1)
cb:=sqrt(d**2-dg**2-dr**2)*s*((db>0)*2-1)
Loop %v%
{
u := SubStr("000000" SubStr( ""
. ((Round(r+cr*A_Index)&255)<<16)
| ((Round(g+cg*A_Index)&255)<<8)
| (Round(b+cb*A_Index)&255), 3) ,-5)
StringUpper, u, u
x .= delim "0x" u
}
SetFormat, Integer, %oif%
return x
}
GuiEscape:
GuiClose:
ExitApp |
|
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Fri Feb 06, 2009 4:27 pm Post subject: |
|
|
Binary integers are cached at load time for literal integers in expressions. Since the presence of SetFormat, Integer disables write-caching of binary integers in variables, when the binary integer is assigned to the parameter x, it is assigned as both a binary integer and a numeric string in the current format. In other words, x contains the string "16777215" or "15728640" instead of "0xFFFFFFFF" or "0xF00000". Since the "0x" prefix isn't required for colour codes, the decimal integer (or part of it) is interpreted as a hexadecimal colour code, resulting in the off coloured lines.
One solution may be to add (in the AutoHotkey source) a function which would:
- be used only to assign a literal integer to a variable,
- would cache a binary integer in the variable as before,
- but would also store the original numeric string in the variable if (write-)caching is disabled.
There are at least two workarounds:
- Pass parameters which aren't in the current numeric format as strings instead of literal numbers.
- Force each parameter into the correct format.
| Code: | Range1 := RGBRange("0xFFFFFF", 0xF00000, -100, "`n")
Range2 := RGBRange("0xF00000", 0x000000, -100, "`n")
;... AND/OR ...
SetFormat, Integer, H
x += 0
|
Personally, I think v2 should abandon SetFormat - along with all of these issues - in favour of a manual Format() function or other syntax. (I believe Chris wishes to maintain compatibility with older scripts up until v2.) |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Fri Feb 06, 2009 4:47 pm Post subject: |
|
|
Thanks for that analysis.
However, I don't fully understand the subtlety of it; so if you think this issue represents a significant incompatibility, I think the source code should be fixed (at least if there's a reasonable way to do so without giving up too much). On the other hand, if this issue is something extremely rare and fixing it would sacrifice performance, maybe nothing should be done.
| Laszlo wrote: | | With this AutoHotkeySC.bin the exe file is twice larger than before (420KB instead of 210KB). Do I need to do something to enable compression? | I can't reproduce that. Perhaps your upx.exe is missing or damaged. If that's not it, it might be solved by installing the most recent non-beta version and then overwriting the two main files with the beta version again.
| tank wrote: | http://www.autohotkey.com/forum/viewtopic.php?p=247351#247351
seems the problem i describe here happens in the non compiled script with the beta | Thanks; that should be fixed in the next release. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Fri Feb 06, 2009 5:13 pm Post subject: |
|
|
| Chris wrote: | | Laszlo wrote: | | With this AutoHotkeySC.bin the exe file is twice larger than before... | I can't reproduce that. | It is not consistent. With the previous beta AutoHotkeySC.bin my script1.exe compiled from a 500 line script1.ahk was 203.5KB, similar size to the non-beta case. With the latest (beta3) AutoHotkeySC.bin the size of script1.exe is 410.5KB. Other scripts did not blow up. Even my 10,000 line real time control script compiles to 214.8KB.
Script1 does not use regular expressions, or other exotic stuff, only transparent windows, which my other compiled scripts do not. It also uses MouseGetPos, relative mouse movements and a Critical subroutine. Is there now an optional component, which is not always included in the exe?
The 210KB size difference is not important. I only report the issue, because it could reveal a potential bug. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Fri Feb 06, 2009 5:21 pm Post subject: |
|
|
There are no large optional components. In fact, the SC/bin file barely changed from one version to the next because I only included the small section of code that recognizes SetFormat and turns of the caching of binary numbers.
Perhaps this is a bug in UPX itself -- maybe it encounters some unusual pattern of characters that causes it to fail to compress the file. You could try the latest version of UPX from http://upx.sourceforge.net/
If that doesn't help, you might try temporarily renaming your UPX and compiling the script again. If the resulting file size is almost exactly the same as the one with UPX enabled, that would seem indicate that UPX gives up early when trying to compress this particular file. |
|
| Back to top |
|
 |
Lexikos
Joined: 17 Oct 2006 Posts: 7299 Location: Australia
|
Posted: Fri Feb 06, 2009 5:37 pm Post subject: |
|
|
| Chris wrote: | | On the other hand, if this issue is something extremely rare and fixing it would sacrifice performance, maybe nothing should be done. | I thought something along those lines.
In your original post you were too specific:
| Chris wrote: | | 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. | It should be something like: "Assigning a literal integer to a variable also converts it to the current integer format." Perhaps the documentation should suggest quoted strings be used to preserve format. |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Fri Feb 06, 2009 6:05 pm Post subject: |
|
|
| Chris wrote: | | You could try the latest version of UPX | Thanks! That reduced the size from 410.5KB to 203.5KB, and the program loads faster, too. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Wed Feb 18, 2009 3:13 am Post subject: |
|
|
Here is a new beta version that improves the speed of thread creation and fixes all the bugs in the Bug Reports forum that were readily fixable.
If you get a chance, please test it with your most demanding scripts, especially ones that create many threads such as complex GUIs, SetTimer, OnMessage(), and the slow mode of RegisterCallback() (e.g. subclassing).
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. |
|
| Back to top |
|
 |
bmcclure
Joined: 24 Nov 2007 Posts: 774
|
Posted: Wed Feb 18, 2009 9:57 am Post subject: |
|
|
Working great for me so far with my development versions of SteamWin, SteamLab, and FOMS.
And maybe it's just my anticipation because of your announcement, but SteamWin GUI windows (custom GUIs with a lot of timers and hotkeys) seem to be more responsive and perform better overall now.
I'm really liking the beta version so far.
Thanks, Chris! _________________ Ben
My Trac projects
My Wiki
[Broken] - My music |
|
| Back to top |
|
 |
Laszlo
Joined: 14 Feb 2005 Posts: 4710 Location: Boulder, CO
|
Posted: Wed Feb 18, 2009 5:51 pm Post subject: |
|
|
| 5 large scripts, one with over 20 threads work flawlessly, also in compiled form. They seem to be faster, too, but it is hard to measure. |
|
| Back to top |
|
 |
Sean
Joined: 12 Feb 2007 Posts: 2462
|
Posted: Thu Feb 19, 2009 2:56 pm Post subject: |
|
|
Thanks Chris, NumPut now works like a charm with Uint64.
BTW, I couldn't test the beta versions extensively, so I've been waiting for Lexikos' additions to be incorporated into it. Although Assume Static and the more flexible dynamic function calls are crucially used, they aren't used heavily so I can temporarily replace them with ones compatible with the beta versions. However, While loop has been used so widely I didn't dare to replace them, and gave up using the beta versions. |
|
| Back to top |
|
 |
Chris Site Admin
Joined: 02 Mar 2004 Posts: 10716
|
Posted: Thu Feb 19, 2009 7:40 pm Post subject: |
|
|
Thanks Sean, Laszlo, bmcclure, and everyone else who has done some testing.
I forgot to mention that 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 |
|
| 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
|