• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
RE: Why are compiled scripts slower than from Script Editor?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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 15:38:09 -0500

I think I may have some important data here.

The Script Editor uses about 20-27% of CPU when running my script.

The compiled application of that same script uses a maximum of about 3-4%
when running.


> ----------
> From: Sprague, Graham
> Sent: Wednesday, March 19, 2003 3:07 PM
> To: Sprague, Graham; AppleScript Users; 'email@hidden'; 'Andrew
> Oliver'
> Subject: RE: Why are compiled scripts slower than from Script Editor?
>
> Here's my setup...
>
> Mac OS X 10.2.4
> Quark 4.11 (Classic)
> FileMaker 6 (Native)
> Script Editor 1.9
> Dual 1.25Ghz G4 w/768MB RAM
>
>
> ----------
> From: Andrew Oliver
> Sent: Wednesday, March 19, 2003 3:05 PM
> To: Sprague, Graham; AppleScript Users; 'email@hidden'
> Subject: Re: Why are compiled scripts slower than from Script
> Editor?
>
> Are you running Mac OS X or 9.x?
>
> If 9.x (as implied by the reference to Peek-A-Boo) your script will
> be
> constrained the memory allocation.
>
> When running in Script Editor, you have the memory block assigned to
> SE to
> play with (which almost every scripter would have increased from the
> default).
>
> When running as a compiled app, you'll have whatever memory
> allocation is
> applied to the app - it's been a long time since I've used 9.x but
> 384K
> comes to mind.
>
> Try upping the memory allocation for your script app and see if you
> see the
> same results.
>
> Andrew
> :)
>
> On 3/19/03 11:23 AM, "Sprague, Graham" <email@hidden>
> wrote:
>
> > 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.
_______________________________________________
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.

  • Prev by Date: Re: the Holy Grail of AppleScript lists
  • Next by Date: RE: Why are compiled scripts slower than from Script Editor?
  • Previous by thread: RE: Why are compiled scripts slower than from Script Editor?
  • Next by thread: RE: Why are compiled scripts slower than from Script Editor?
  • Index(es):
    • Date
    • Thread