Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
- Subject: Re: Highlights of AppleScript 1.5.5 in Mac OS 9.1
- From: Nigel Garvey <email@hidden>
- Date: Thu, 11 Jan 2001 13:48:31 +0000
Timothy Bates wrote on Thu, 11 Jan 2001 13:19:36 +1100:
>
On 1/10/01 10:55 AM, "Nigel Garvey" <email@hidden> wrote:
>
> If it's as fast as the current 'round', it'll still be seventeen times
>
> quicker to use a handler:
>
On a plain Jane B&W G3 350, I get:
>
>
>
***********start script ********
>
>
set start1 to current date
>
>
repeat with n from 1 to 500
>
round 122.5
>
end repeat
>
>
set end1 to current date
>
>
>
set start2 to current date
>
>
repeat with n from 1 to 500
>
rndIEEE(122.5)
>
end repeat
>
>
set end2 to current date
>
>
set time1 to end1 - start1
>
set time2 to end2 - start2
>
>
return {time1, time2}
>
-->{9,0}
>
>
on rndIEEE(n)
>
if (n mod 2) ^ 2 > 0.25 then return n div 0.5 - n div 1
>
n div 1
>
end rndIEEE
That's a brain bender, isn't it? Running your script here, I get a result
of {2,0}, which seems to suggest that my 4400 603e 200 is performing
'round' about four and a half times as quickly as your hotter machine!
Presumably there are other factors involved here, such as machine
configuration, OS version, etc.
I based the claim to my handler's "seventeen times" speed advantage on
comparisons using 'the ticks' from Jon's Commands. A 'tick' is 1/60th of
a second, which is a far less coarse measurement than the full
second-in-progress read from the clock by 'current date'. Changing
'current date' to 'the ticks' in your script, I typically get the result
{93,5} - which actually shows the handler to be just over eighteen and a
half times as fast, but is broadly consistent with my claim. The
advantage on your computer must be between four or five times that!
NG