This latest slowness hanging freeze is not like the others

It seems that SD is hanging more frequently and going much more slowly at times.

At home I attributed this to scripts working with long lists. This one, at the office, is different.

Basically I launched SD. Opened a new script window. Searched for a few terms in the info pane. Right-clicked on a few results to reveal in finder.

Then opened an existing applet and hangs and slowness.

Here’s a sample:

–> Script Debugger 7.0.3 (7A55)
–> Mac OS 10.11.6 (15G20015)

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.

I don’t get it either. I use a minimal number of fonts in SD, and they are system fonts.

It seems to happen more in long scripts than short scripts. Also could be related to code folding? I have been using that a lot more lately.

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.

I’ll make a movie to illustrate

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.

https://www.dropbox.com/s/431af3ntk9q82ll/CodeFoldingHangs.mov?dl=0

Here’s a link to the movie in case the forum software doesn’t show it. You can open that link directly in Safari.

I noticed on playback that QT doesn’t show the cursor change to the hang cursor (spinning rainbow). In the movie I mention when there’s a hang.

For now I’m turning code folding off, as much as I like it.

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).

I’m one happy scripter.

But I do miss code folding.

So is this a bug, right? Can anyone else reproduce? Should I be seeing if it happens on different systems?

Is it being seen to?

We’re here. Code folding is CPU-intensive — there’s no way around that — but it looks like there’s something more going on here.

OK, cool, thanks. I hope this can be fixed because I really dig code folding, a lot more than I thought I would!

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?

I’m looking into this issue. The solution is complex enough that it probably won’t make it into Script Debugger 7.0.4.