Re: Why Slow Then Fast
Re: Why Slow Then Fast
On Sep 7, 2010, at 3:35pm, Shane Stanley wrote:
> On 8/9/10 3:51 AM, "Luther Fuller" <email@hidden> wrote:
>
>> I have a script that I run from time to time. It takes about 60 sec to
>> complete.
>> If I immediately run it again, the script completes in 8 sec.
>> Why?
>
> That's hard to know without knowing what handlerCalledByMe() is doing. For
> example, if it's reading a large file, the file could be cached. If it's
> talking to System Events, it may need to launch the app the first time.
>
> But if you're worried about speed, using Finder properties to parse a path
> rather than something like text item delimiters seems a poor choice.
Not wanting a 60 second delay in executing a simple script is not exactly worrying about speed, and the difference in speed between the finder parsing a single path one time and any other method would be imperceptible.
And while the problem may be in the handler, it may also be in the application containing the handler. Is that a script? Does have a run handler that executes when opened? Is it stay open, so it doesn't have to launch on subsequent runs?
Also if memory on the mac is tight that could account for the inconsistent timing too. What if you don't run it again immediately, what if you do other things with other aps, then come back to it?
ES _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden