Re: iTunes Script Performance
Re: iTunes Script Performance
- Subject: Re: iTunes Script Performance
- From: "Chris Espinosa" <email@hidden>
- Date: Mon, 17 Mar 2003 11:26:28 -0800
From: "Jos Hofman" <email@hidden>
Sent: Saturday, March 15, 2003 7:00 AM
Subject: iTunes Script Performance
>
Hi,
>
>
When running a script from iTunes' own script menu
>
(~/Library/iTunes/Scripts) the performance is about 10 times faster than
>
running the same script as a standalone application or a compiled script
>
from script menu.
>
>
Why ? Is the same kind of performance boost possible with FileMaker /
>
Mail.app ?
The business end of AppleScripts are Apple Events, messages that are sent
from the scripting engine to the application being scripted. When the
application is running the script itself, these messages are "direct
dispatched", that is, they go right to the application routine that performs
the function. When the script is running in a separate process (in the
Script Editor, as an applet, from the Script Menu) the messages ned to be
sent from one process to the other, wait for the app to receive and process
the message, then wait for the app to reply -- all of which takes more time.
If you recall on Mac OS 9 the "OSAMenu" extension from Leonard Rosenthal had
two modes, "fast" and "compatible." The "fast" mode executed scripts in the
process space of the frontmost app, for speed. But many apps on 9 weren't
expecting that and would have trouble with it, hence the "compatible" mode
that ran them in a separate process. Script Menu on Mac OS X only has the
"compatible" mode, and apps that want to support "fast" mode can add (as
iTunes does) their own script-running facility. The same is true in
FileMaker Pro, Apple Mail, etc.
Chris Espinosa
Apple
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.