Re: Why are compiled scripts slower than from Script Editor?
Re: Why are compiled scripts slower than from Script Editor?
- Subject: Re: Why are compiled scripts slower than from Script Editor?
- From: Axel Luttgens <email@hidden>
- Date: Sun, 02 Feb 2003 13:03:56 +0100
Patrick S. Page-McCaw wrote:
[snip]
To summarize, running a simple repeat script from a stand-alone double
clickable application is slower (each repeat takes longer) and more
variable (the duration of the repeat varies) compared to running the
identical script from within SMILE or Script Editor. Changing the
priority of the stand-alone from Normal to High using Peek-a-boo does
not change this result.
Really guessing here...
The problem must be inherent to the queuing mechanism; I guess the
'delayIt' command works the same way the 'delay' command does, by queing
an event that should be triggered some time later.
That is, the delay may be as precise as possible, you still never master
what other events get queued in the meantime, nor their priority.
If this is true, changing the app's priority can't help, since this
happens outside of it.
Could you check with something like this:
set nextPulse to GetMilliSec + 500
repeat
repeat while GetMilliSec < nextPulse
end repeat
-- processing statements here
set nextPulse to nextPulse + 500
end repeat
and see if you still observe such differences between the editor and the
stand-alone contexts?
Of course, this will eat a lot of your computer's CPU...
But this should at least improve the precision of the pulses.
The question is why? It is very impressive that AppleScript can do
this at all, I just wish that I understood this behavior.
This is a two-parts question: why longer, and why less precise?
The precision part is partially treated above.
I suppose the 'GetMilliSec' command is from some OSAX.
I just tried here (I am on Mac OS 10) with the standard additions'
command 'ASCII number' call in a loop from within Script Editor and from
within a stand-alone.
It seems that 'ASCII number' is about three times longer when called
from the stand-alone.
Looks like as if the editor environment did some "pre loading" of
external commands - possibly what Emmanuel meant in his post.
(this makes me reminiscent of something, but very vaguely - has someone
more precise records than mine?)
HTH,
Axel
_______________________________________________
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.