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
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Thu Jan 01, 2009 3:38 pm    Post subject: Reply with quote

Thanks to Lexikos, the release has been fixed so that bitwise operations involving floating point variables don't wrongly cache those variables as integers. Without the correction, the following example shows "2" instead of the expected "3.000000":
Code:
b := 1.5
a := b ^ 1
MsgBox % b * 2

The topmost post has been updated with the following links:
www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-new3.exe (238 KB)
www.autohotkey.com/misc/AutoHotkey-Pre-1.0.48-BIN-new2.zip (240 KB) (BIN file for making compiled scripts)
Back to top
View user's profile Send private message Send e-mail
Laszlo



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

PostPosted: Thu Jan 01, 2009 4:31 pm    Post subject: Reply with quote

The link still points to the old AutoHotkeySC.bin, w/o the bugfix, so compiled scripts still show 2 intead of 3.000000 with the test script. In the first post there are two links to the bin file, which needed update.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Thu Jan 01, 2009 4:43 pm    Post subject: Reply with quote

Thanks. I've fixed the BIN/compiler ZIP file to contain the new version instead of the old one. All the old links (in case anyone has saved them or they appear elsewhere in the topic) also contain the newest versions.
Back to top
View user's profile Send private message Send e-mail
KalleW



Joined: 09 Jun 2005
Posts: 31
Location: Germany near Cologne

PostPosted: Tue Jan 06, 2009 11:09 am    Post subject: Problem and comment on: Setformat Float, xxx Reply with quote

Hi Chris,

really great the idea of storing the real number as binary (Real*8 = Double = precision 15 decimal digits) and not as a string and thanks for your work.

I was waiting for that: Date + time calculation starting in 1582 needs 14 digits for msec precision. Used "SetFormat Float 0.16E" before.

Chris wrote:
thinking of adding a new mode such as SetFormat, FloatFast, 0.6 that would leave caching enabled


May be it could be better to have a conversion routine instead of a format statement that only works on direct output (e.g. Msgbox) like
Code:

var := 81.123456789
string := ConvDecimal( %var%, 0.2 ) " Dollar"

which could be used in composing out-string too.
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Jan 06, 2009 1:11 pm    Post subject: Re: Problem and comment on: Setformat Float, xxx Reply with quote

KalleW wrote:
May be it could be better to have a conversion routine instead of a format statement that only works on direct output (e.g. Msgbox) like
Code:

var := 81.123456789
string := ConvDecimal( %var%, 0.2 ) " Dollar"

which could be used in composing out-string too.
That is good, though it would take a while to research and design something that's flexible yet intuitive. By contrast, extending SetFormat is almost trivial and would require minimal changes to any existing scripts that need maximize performance.

I expect your idea will be implemented in some future version, especially a major version like v2 that is expected to have more functions and fewer commands. Perhaps more things like FormatTime could be added after researching other languages for the best syntax. It would also be good to have some date/time functions to provide a more intuitive way to compare and manipulate dates and times.

Thanks.
Back to top
View user's profile Send private message Send e-mail
KalleW



Joined: 09 Jun 2005
Posts: 31
Location: Germany near Cologne

PostPosted: Tue Jan 06, 2009 1:42 pm    Post subject: Re: Problem and comment on: Setformat Float, xxx Reply with quote

Chris wrote:
It would also be good to have some date/time functions to provide a more intuitive way to compare and manipulate dates and times.


Here they are:
http://sourceforge.net/projects/datetimelib/

In short:

Library routines for computation of date and time functions since the Gregorian Calendar was introduced on 1582-Oct-15:

- add/subtract days&hh:mm:ss to/from a given date&time
- with variables type Double: exact calculations down to 0.001 sec (1 msec)
- considered all leap years (the anormalities every 4, 100 and 400 years)
- considered the changes from summer time (Daylight Saving Time DST) to winter time and back
- compute the start and end dates of DST for a given year
- compute UTC (Universal Time = Greenwich Time) to local time; considered DST
- compute weekdays
- convert to Excel compatible date/time values
- template for your own implementation
- documentation inside the routines and in a handbook


Last edited by KalleW on Tue Jan 06, 2009 2:33 pm; edited 1 time in total
Back to top
View user's profile Send private message
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Tue Jan 06, 2009 2:13 pm    Post subject: Reply with quote

To avoid code bloat, AutoHotkey currently uses the Windows API for date/time math. Hopefully it is just as accurate as the library above.
Back to top
View user's profile Send private message Send e-mail
SKAN



Joined: 26 Dec 2005
Posts: 8688

PostPosted: Tue Jan 06, 2009 3:49 pm    Post subject: Reply with quote

Chris wrote:
Hopefully it is just as accurate as the library above.


It is AHK lib.. Rolling Eyes
_________________
URLGet - Internet Explorer based Downloader
Back to top
View user's profile Send private message Send e-mail
Tahattmeruh
Guest





PostPosted: Tue Jan 06, 2009 9:37 pm    Post subject: Reply with quote

I have a small hotkey to start a new empty notepad.

;New Notepad
^!n::Run notepad.exe

But since the new beta version, I always starts in the background and I have to click on the taskbar icon.
With the previous version, I was the topmost program
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Wed Jan 07, 2009 1:03 am    Post subject: Reply with quote

No changes were made to those parts of the program. So it could just be a timing issue or some OS quirk.
Back to top
View user's profile Send private message Send e-mail
BenCh
Guest





PostPosted: Thu Jan 22, 2009 12:32 pm    Post subject: Problem with NoDecompile Reply with quote

What am I doing wrong? I can't get scripts to compile successfully using the NoDecompile switch. Are you sure the version in the zip file is the right one? (After all, the zip file says "new2" not "new3"...)
Back to top
Chris
Site Admin


Joined: 02 Mar 2004
Posts: 10716

PostPosted: Thu Jan 22, 2009 7:02 pm    Post subject: Reply with quote

I've successfully tested the NoDecompile switch with this version. So perhaps your version of Ahk2Exe is too old. Try replacing it with the following: www.autohotkey.com/misc/Ahk2Exe-1.0.47.06.zip
Back to top
View user's profile Send private message Send e-mail
BenCh
Guest





PostPosted: Fri Jan 23, 2009 12:42 pm    Post subject: Reply with quote

Thank-you, that fixed it.
Back to top
IanH1960



Joined: 10 Apr 2007
Posts: 8

PostPosted: Sat Jan 31, 2009 5:59 pm    Post subject: Different uncompiled and compiled behaviours Reply with quote

Have been checking the beta on some scripts and am indeed seeing faster performance.

One strange behaviour on same script between its uncompiled and compiled forms. I'm fairly sure I'm using the beta AHK .exe and the beta AHK SC.bin in the Compiler directory.

It's the effect of "SetFormat, integer". Here's a code snippet

Code:
int1 := 100

MsgBox int1 decimal: %int1%

SetFormat, integer, hex
  int1 += 0
SetFormat, integer, d

MsgBox int1 hex: %int1%


If I run this by double clicking the .ahk the second MsgBox reports int1 as "0x64" as expected.

If I compile the script then run the .exe the 2nd MsgBox reports int1 as "100"

I can get the compiled version to report "0x64" by removing the second SetFormat statement.

Would appreciate if anyone could just check this. Should I be doing anything other than installing the AHK beta .exe in the AHK directory and the beta ..SC.bin in the Compiler subdirectory?

This is significant as I use this method to prepare a hex string for writing to a COM port.

Many thanks

Ian
Back to top
View user's profile Send private message
Lexikos



Joined: 17 Oct 2006
Posts: 7299
Location: Australia

PostPosted: Sun Feb 01, 2009 2:55 am    Post subject: Reply with quote

AutoHotkey_L (my custom build) has been updated with bug-fixes and optimizations from the current beta, a fix for the bug reported by Ian, and one new feature.

Chris, the section of code which disables binary number write-caching was omitted from SC builds, along with load-time validation of SetFormat's parameters.
Back to top
View user's profile Send private message Visit poster's website
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 5 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