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: "Sprague, Graham" <email@hidden>
- Date: Wed, 19 Mar 2003 14:23:15 -0500
I am getting similar results with my compiled apps. This is absolutely
ridiculous there should be no precievable difference in performance beyond
the launching times. My script takes 4X longer as an app than as a compiled
script run from script editor. Common guys there's a bug here!
In Script Editor Window
Wed Mar 19 13:29:25 EST 2003 0.533333333333 minutes for this session
Wed Mar 19 13:29:25 EST 2003 0.533333333333 minutes per document
Wed Mar 19 13:29:25 EST 2003 8.0 seconds per page
Wed Mar 19 13:29:25 EST 2003 FlushXress Finished
As application
Wed Mar 19 13:32:41 EST 2003 2.166666666667 minutes for this session
Wed Mar 19 13:32:41 EST 2003 2.166666666667 minutes per document
Wed Mar 19 13:32:41 EST 2003 32.5 seconds per page
Wed Mar 19 13:32:41 EST 2003 FlushXress Finished
>
----------
>
From: Axel Luttgens
>
Reply To: email@hidden
>
Sent: Sunday, February 2, 2003 7:03 AM
>
To: AppleScript Users
>
Subject: Re: Why are compiled scripts slower than from Script Editor?
>
>
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.
_______________________________________________
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.