Re: Spinning Pizza Wheel. Why?
Re: Spinning Pizza Wheel. Why?
- Subject: Re: Spinning Pizza Wheel. Why?
- From: Shane Stanley <email@hidden>
- Date: Thu, 26 Mar 2015 17:33:37 +1100
On 26 Mar 2015, at 5:08 pm, Brian Christmas <email@hidden> wrote:
>
> In my very large project, I keep getting the ‘Spinning Pizza Wheel’ which lasts for about a minute, then hands control back to the Application.
The spinning cursor basically means that the app is not keeping up with the rate of new events being added to the event queue. That means you're hogging the main queue, and not giving the app time to handle other stuff (things like mouse moves and stuff). So you need to try to keep your processes as short as possible, and break them up where you can't using something like the doEventFetchHandler(). This is why AppleScript is not a good choice for complex apps: it can only work on the main thread, the same as the interface. Objective-C apps have the luxury of being able to move processes on to background thread.
However, there are other things beyond your control. One is when garbage collection kicks in, if you're using it, and another is AppleScript's garbage collection, which kicks in periodically to clean house. You can't really do anything about these. And if your app is very large, AppleScript will probably need to clean up and reclaim memory more often. That said, a minute sounds excessive.
All I can really suggest is that you add some log statements to the main area you think it's happening, to see if it's a particular block of code. If it is, you can then try to deal with it, either by breaking it up, or doing more event fetching to keep the UI happy.
--
Shane Stanley <email@hidden>
<www.macosxautomation.com/applescript/apps/>
_______________________________________________
Do not post admin requests to the list. They will be ignored.
applescriptobjc-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden