It appears the slowdown is somewhere in the Cocoa text layout system. I saw this a couple of times in your previous Sample reports as well. Not sure what to suggest. Corrupt fonts can sometimes do this. Sorry, no concrete suggestions come to mind.
Now I think code-folding with larger chunks of text folded is the culprit.
Here’s what I’m seeing.
I open a script with large blocks (in one case 700+lines) that could be folded. I open Activity monitor and watch SD.
When I edit and compile the unfolded script CPU usage stays low and rarely climbs above 20%.
When I fold the large block then edit and compile SD hangs briefly and CPU usage soars (90 -105%) and I get more hangs, some brief some long. It seems that the longer I work with these scripts the worse the behavior becomes.
It’s a 3 1/2 minute movie, but in case you can’t see it here’s a description.
There is an Activity Monitor window showing SD CPU usage and an SD window with an 800+ line script and a 700 line repeat loop.
Without code folding CPU stays moderate (20-30%) or low (0-5%); mostly low; editing and compiling do not cause hangs.
When the large block (700+lines) is folded, SD hangs frequently; CPU usage spikes to 100% ±; CPU usage stays high >40% for significant periods and there are frequent spikes and hangs; simple editing (typing ) causes CPU spikes and hangs. Compiles always generate hangs and it takes significantly longer for SD CPU usage to drop to a low level when idle.
All these issues go away when code folding is turned off again. No relaunch needed.
So I’ve gone a couple days now without using code folding. I have to turn it off on every script I open because I have become a habitual code folder.
I’m still working with large scripts and lots of data, but now, all these issues have gone away. No hangs, no slowness, no issues getting progressively worse, no having to relaunch after an hour or so. (I don’t think I’ve relaunched since I stopped code folding).
Now I’m noticing I’m still getting occasional hangs that I think might be related.
I’m working with a script that generates a list with hundreds of items, each a three-item list. {emailAddress, senderName, emailSubject}
During debugging if I observe the property containing this list in “best” view, and click a triangle then click a sub-triangle to view the contents of a sub-list, then click both those triangles again, I start to get frequent hangs for as long as that variable is being observed.
Because both scenarios involve SD having info but not displaying it, I’m thinking they might be related?