Strange performance problem--near constant beachball of doom


(Jake Bernstein) #1

Hi there, I’m experiencing terrible performance and I have no idea what the culprit could be. I get the beachball of death even when I’m simply accessing menu items (such as trying to hide the Tab bar). I’ve closed all but one document and the one I have open isn’t even particularly large. In fact, it’s likely quite small by TBX standards.

What’s the best way to resolve these issues? I’m on a 2017 MBP, so I can’t imagine it’s the hardware. Thanks!


(eastgate) #2

Send your problem document to info@eastgate.com and we’ll take a look.

The most likely culprit, in my experience, is trying to do lots of computation in a $DisplayExpression. Since each display expression must be evaluated every time the display changes (and sometimes when it might change!), trying to do something complex with every item in the document in a display expression can give you quadratic run times. Fortunately, this is always a mistake — there are better ways to accomplish the task!


(eastgate) #3

Oh – and, of course – keep good backups. When something goes wrong at 2PM, it’s always nice to know that you can get back to those rosy days of noon when all was well.


(Jake Bernstein) #4

I sent you the problem document, but I think I figured it out. I think there was an agent in the Prototype container that was looking at EVERY SINGLE note. I had borrowed some prototypes from someone else and I suspect that was the culprit.


(eastgate) #5

An agent that looks at every note in a document is not, as a rule, a problem: most agents do. Of course, if the agent looks at every note, and compares it (say) with every other note, it’s easy to find yourself with a document where agent updates take (say) 0.1 seconds when you have ten items, and 1000 seconds when you have 100.


(eastgate) #6

Bystanders: I think we’ve found the problem in this document, which seems to have been a combination of (a) a syntax error, and (b) accidentally leaving an agent in the /Prototypes folder.