Kill this canard once and for all
Kill this canard once and for all
- Subject: Kill this canard once and for all
- From: Chris Espinosa <email@hidden>
- Date: Thu, 11 Jan 2001 14:25:29 -0800
Let me make this perfectly clear: there is not now, nor has there ever
been, a "60 Hz clock" restriction on the sending of AppleEvents in the
Mac OS.
Several years ago, I said there was. I was wrong. There are some
bizarre and terrifying interactions among the Process Manager and the
AppleEvent Manager that make event delivery different in every version
of the Mac OS, but ever since we went to the Power PC processor, every
Mac and every version of the Mac OS has been able to send several
hundred to several thousand AppleEvents per second between applications.
You don't need to take my word for it: you can test it for yourself.
set start_time to current date
repeat 1000 times
tell application "Finder"
name
end tell
end repeat
set elapsed_time to (current date) - start_time
display dialog "Average " & 1000/elapsed_time & " events per second."
Run this on your machines. Run it in the Script Editor, as an applet,
from OSAMenu, wherever. Run it alone or with other applications
running. Run it on 8.6, 9.0, or 9.1. Use different events than "name"
or different applications than "Finder".
You'll get different numbers every time. I've seen numbers as low as 30
events/second and as high as 2000 (on 9.1 on a 500MHz machine with the
app sending the "random number" event to itself). But you will not see
60 events/second, except by sheer coincidence.
Remember this when thinking about script speed. The circumstances of
the script execution (how fast the target application processes the
event, whether it's being sent between applications, what other
applications are running and how piggy they are) are orders of magnitude
more important than how fast the Process Manager relays events between
applications. We've had some OS releases where bad interactions in the
OS have made your scripts noticeably slower, and we've made some fixes
in 9.1 that may make some of your scripts noticeably faster. But the
real key to overall script performance is much more dependent on the
scriptable application and the script itself, rather than anything we
can do in the OS or AppleScript.
Regards,
Chris
From: John Christie <email@hidden>
>
Subject: Re: Highlights of AppleScript in Mac OS 9.1
>
>
At 11:15 PM -0800 1/9/01, Ed Stockly wrote:
>
>
>
> Process Manager The Process manager is now native. According to the
>
> release
>
> notes, it speeds up event handling and switching between applications,
>
> especially with AppleEvents.
>
>
However, it wasn't nativeness that was the real problem, it
>
was the clock that underlied its functioning. If the clock is still
>
60 Hz then improvements may not be noticeable.