AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Beta version pre-v1.0.48: Up to 3x faster performance
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Reply to topic    AutoHotkey Community Forum Index -> Announcements
View previous topic :: View next topic  
Author Message
Lexikos~
Guest





PostPosted: Fri Feb 20, 2009 3:01 am    Post subject: Reply with quote

Sean wrote:
BTW, I couldn't test the beta versions extensively, so I've been waiting for Lexikos' additions to be incorporated into it.
FYI, my latest release includes some of the beta changes, but not the latest lot.
Back to top
pekkle



Joined: 20 Jan 2009
Posts: 13

PostPosted: Fri Feb 20, 2009 3:40 am    Post subject: Reply with quote

bug... with the latest exe and bin, ahk2exe /nodecompile not working any more, it would create invalid exe file.
Back to top
View user's profile Send private message
Sean



Joined: 12 Feb 2007
Posts: 2462

PostPosted: Fri Feb 20, 2009 5:14 am    Post subject: Reply with quote

Lexikos~ wrote:
FYI, my latest release includes some of the beta changes, but not the latest lot.
OK, I downloaded it. Thanks.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Feb 20, 2009 11:51 am    Post subject: Reply with quote

pekkle wrote:
bug... with the latest exe and bin, ahk2exe /nodecompile not working any more, it would create invalid exe file.
Thanks; I've fixed that. You can re-download it from the same link: www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-BIN-new4.zip (240 KB)
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Fri Feb 20, 2009 1:27 pm    Post subject: Re: Darn Green Line! Reply with quote

Colorize wrote:
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


Now in beta4 appears 2 green lines (another one at the top)
Back to top
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Fri Feb 20, 2009 2:29 pm    Post subject: Re: Darn Green Line! Reply with quote

Anonymous wrote:
Now in beta4 appears 2 green lines (another one at the top)
I still see one green line at the top and one in the middle. This area has not changed since the previous beta, so the explanation and workarounds I mentioned still apply.
Back to top
View user's profile Send private message Visit poster's website
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Fri Feb 20, 2009 2:47 pm    Post subject: Re: Darn Green Line! Reply with quote

Lexikos wrote:
Anonymous wrote:
Now in beta4 appears 2 green lines (another one at the top)
I still see one green line at the top and one in the middle. This area has not changed since the previous beta, so the explanation and workarounds I mentioned still apply.

I'm not sure what the workarounds were; maybe they're the same as the following:

Add the following red line beneath the SetFormat line:
Code:
SetFormat, Integer, H
x += 0  ; Convert from decimal to hex.
This is caused by the converse of the following change: 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.

I've revised it to read: When SetFormat Integer is in effect, assigning a literal integer to a variable (or passing a literal integer to a function) immediately converts the integer to the current format (decimal or hex). Usually this is only a display issue.
Back to top
View user's profile Send private message Send e-mail
toralf n-l-i
Guest





PostPosted: Sat Feb 21, 2009 10:41 pm    Post subject: Reply with quote

Hi Chris,

I am unsure where to post it. But since this is closely linke dto this beta, I thought it would be ok to post it here.

In the Manual about the SetFormat it is said:
Manual wrote:
Advantages: The fast mode retains the ability of variables to cache integers and floating point numbers, which can substantially accelerate numerically-intensive operations.
It took me a while to understand what was meant by this sentence. Until I realized that otherwise the numbers would be cached as strings (Am I right, or totally mistaken?). If I'm right, I would like to suggest to change the documentation to give a more direct hint.
Suggestion wrote:
Advantages: The fast mode retains the ability of variables to cache integers and floating point numbers, which can substantially accelerate numerically-intensive operations, since otherwise all variables would be cached as strings.
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Sun Feb 22, 2009 12:17 am    Post subject: Reply with quote

Thanks; I've clarified it to read:
The fast mode preserves the ability of variables to cache integers and floating point numbers, which can substantially accelerate numerically-intensive operations. (By contrast, the slow mode forces all numeric results to be immediately converted and stored as strings.)
Back to top
View user's profile Send private message Send e-mail
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Sun Feb 22, 2009 12:49 am    Post subject: Reply with quote

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

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)
Back to top
View user's profile Send private message Send e-mail
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Mon Feb 23, 2009 9:08 pm    Post subject: Memory leak Reply with quote

I am not sure if it is new to the AHK beta. The following little script keeps on increasing its memory use, until it eventually crashes.
Code:
SetTimer MonitorJoysticks

MonitorJoysticks:
   dllcall("winmm.dll\joyConfigChanged", UInt,0) ; Force re-registering joysticks
   GetKeyState("JoyName")
Return

!z::ExitApp
The dll call sends messages to the joystick driver about calibration data changes. After that we acquire the name of the joystick driver (checked if it becomes empty in the full script). In the timer subroutine none of the commands alone causes memory leak.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Feb 24, 2009 2:04 pm    Post subject: Reply with quote

I can see that the memory does increase gradually. When run overnight with the older, non-beta version of AutoHotkey, Task Manager's "mem usage" increased from 3976 to 4320 (I also changed the SetTimer line to use a period of 1 instead of unspecified).

When run in the compiler's debugger, the call stack doesn't appear to be growing larger; so it doesn't appear to be a problem such as unwanted recursion.

Also, the script's VM size doesn't increase, which I think means that the program is not allocating additional memory from the heap as time goes on. This is further supported by the fact that in debug mode, breakpoints on the most likely memory allocations are never reached.

Also, it doesn't appear to be an issue with DllCall's LoadLibrary() because that call is never reached (WinMM.dll is already loaded).

I also tested it with a loop containing "Sleep 1" instead of SetTimer, and the same thing seems to happen. Strangely, removing the Sleep and allowing it to run very fast doesn't seem to increase the rate of memory growth.

The fact that "mem usage" increases but not "VM size", may imply that some kind of shared OS resource is increasing its memory utilization. This is further supported by the fact that Process Explorer reports that the working set "private" is not increasing, but the working set "shareable" and "shared" seem to be increasing. Therefore it's tempting to write this off as some kind of OS bug. However I won't rule out the possibility that it's a bug in the program, perhaps something involving GetKeyState() [though I did review that code and there don't seem to be any untested memory allocations in it].

I'm near the end of what my debugging skills can do; I'm not sure what more should be checked.

Comments or further testing are welcome from anyone.
Back to top
View user's profile Send private message Send e-mail
tonne



Joined: 06 Jun 2006
Posts: 1651
Location: Denmark

PostPosted: Tue Feb 24, 2009 2:52 pm    Post subject: Reply with quote

Sysinternal just released a new memory tool vmmap - maybe it can shed light on the incresed memory usage.
_________________
RegEx Powered Dynamic Hotstrings
COM
AutoHotkey 2
Back to top
View user's profile Send private message
Laszlo



Joined: 14 Feb 2005
Posts: 4710
Location: Boulder, CO

PostPosted: Tue Feb 24, 2009 4:19 pm    Post subject: Reply with quote

Some more info about the joystick monitor's memory use:
- If there is no joystick connected (unplugged), the memory increase stops. Reconnecting the joystick restarts the memory increase.
- In my Vista PC, SetTimer...,1 increased the memory use to 200MB in just 10 minutes. At 330MB the PC slows down, and some disk activity occurs (maybe swapping something to disk?).
- Fixing this issue was important, because joystick using applications need to know if a joystick gets unplugged. GetKeyState alone does not help, because it returns the last valid data, long after the joystick was removed, so the application appears to be frozen. If there is a bug in winmm.dll\joyConfigChanged, another method would be badly needed. Any idea where to look?
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Feb 24, 2009 6:52 pm    Post subject: Reply with quote

Laszlo wrote:
If there is no joystick connected (unplugged), the memory increase stops. Reconnecting the joystick restarts the memory increase.
- In my Vista PC, SetTimer...,1 increased the memory use to 200MB in just 10 minutes.
tonne wrote:
Sysinternal just released a new memory tool vmmap - maybe it can shed light on the incresed memory usage.

Thanks. I tried it and I think that's a good way to proceed. However, since the issue is not clearly defined on my system (I don't have a joystick hooked up), it might be best if someone with a joystick tries it.

VMMap requires no installation. Just unzip it, run the file, and select a process: http://download.sysinternals.com/files/vmmap.zip

Hopefully it will reveal a more precise location of the memory usage.

Laszlo wrote:
If there is a bug in winmm.dll\joyConfigChanged, another method would be badly needed. Any idea where to look?
Offhand I don't; it's been a long time since I reviewed the Windows joystick functions.
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Reply to topic    AutoHotkey Community Forum Index -> Announcements All times are GMT
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 7 of 9

 
Jump to:  
You cannot post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group