Editor freezes for minutes after a compile to PDF

Jo
JoRo
Posts: 406
Joined: Sat May 26, 2018 6:40 am
Platform: Mac

Mon Jul 09, 2018 9:45 pm Post

FWIW, both of the sample projects compile without delay or issue using Scrivener 3.0.3 on a MacBook Pro running Mojave beta.

User avatar
AmberV
Posts: 22035
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Tue Jul 10, 2018 12:36 pm Post

Thanks! Okay, I’ve switched over to my 10.13 test install, since I use 10.12 on a daily basis and was having no luck reproducing the problem with the sample project. It’s been a while since I’ve looked at that install, so it is a few minor points behind (10.13.3). I’m in the process of downloading the update (it’s going to be a good long while as my ’net is slow), so I’ll be better able to test that aspect of your configuration. At the moment, with 10.13.3, I get instantaneous access to the project after compiling.

I’ve looked over the content and nothing strikes me as being particularly odd about it. I wondered at first if perhaps you were using unusual multibyte quotation punctuation, but it appears to all be standard, even ASCII-level simple. Clearly there is something else at bay, despite this being the trigger on your system. If straight foot/inch marks in text files caused this problem so simply we’d be hearing quite a lot about it!

Meanwhile I thought of a few things to ask, and try:

  • Do you use the option to load the PDF in a viewer after it is compiled, and if so which viewer do you use?
  • And along with the above: what happens if you switch that option off, or use Preview/Skim (those are two I tested).
  • After the internal compile process is complete, you should see a “Processing PDF” alert, with a progress bar that counts up by page. This is as far as I know a part of macOS generating the PDF, during which Scrivener must wait until it is done. A long document may indeed take a while to collate, and if for some reason this dialogue is obscured or not showing, then it might lead one to believe the software is unresponsive.

When you get a chance, try a safe boot with all peripherals but the necessary input devices unplugged. It will be by nature slow and awkward to work within, especially if you have a Retina screen, but even so with these two test projects there should be a noticeable difference between the two. Or if not—if in Safe Mode you are cleanly returned to the project that reproduces the slow-down with no ado, then we might be able to narrow this down to a software conflict of some sort.

Your next step would be to boot back normally, and then hold down the Shift key during the log in process to your account (after typing in your password). This inhibits startup software from launching, and so the same test should then be run with nothing but Finder and Scrivener running. If that proceeds without problems, then you’ll need to audit the background utilities and software you use on a regular basis, as well as attaching devices and mounting network drives you might use.

Meanwhile I’ll continue downloading Apple’s 2.6gb (!?) of bug fixes. ;)
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

KM
KMRA
Posts: 13
Joined: Wed Jul 04, 2018 6:11 pm
Platform: Mac
Location: Ghent, Belgium and Egham, UK

Wed Jul 11, 2018 10:14 am Post

Thanks ever so much for your continued efforts!
Concerning your suggestions:
I don't automatically load the PDF. The problem persists even when I have quit Acrobat Reader entirely.
I do see the alert box you mentioned (It's called "Save" I think?) and I see the pages counting, and rather quickly at that. It takes much, much less than the post-compile wait.
The problem persists in safe-mode, and also in normal mode without loading startup software.

I'm now going to try this on my son's MacBook, see what comes up there.

KM
KMRA
Posts: 13
Joined: Wed Jul 04, 2018 6:11 pm
Platform: Mac
Location: Ghent, Belgium and Egham, UK

Wed Jul 11, 2018 11:14 am Post

And... the problem persists even on the other MacBook (a more recent model, bought in a different shop), which is still on MacOS 10.12.6.
I created a new project, copied the text snippet a number of times up to 76K words and, bam, same problem. Getting ever so paranoid, I even created a new project and typed in a text manually, with lots of apostrophes, and duplicated it to 54K. Same problem.
Baffling...

KM
KMRA
Posts: 13
Joined: Wed Jul 04, 2018 6:11 pm
Platform: Mac
Location: Ghent, Belgium and Egham, UK

Wed Jul 11, 2018 12:03 pm Post

One important thing: I only get the spinning ball as soon as I do more complicated things like using the mouse several times to select text, not when only typing a few characters. Thus, to be entirely sure that the problem occurs one best takes a look at the %CPU entry of Scrivener in Activity Monitor and see it go up to about 100%.

KM
KMRA
Posts: 13
Joined: Wed Jul 04, 2018 6:11 pm
Platform: Mac
Location: Ghent, Belgium and Egham, UK

Wed Jul 11, 2018 12:57 pm Post

Ah!
The problem goes away when in "System Preferences/Keyboard/Text" I untick "Use smart quotes and dashes".
While it does not explain what has been going on, it's a reasonable workaround for me.
Thank you very much for your assistance (and JoRo, too!), and keep up the good work.
(If you do at some point find the underlying reason for this strange behaviour, do let me know!)

All the best,
Koenraad

User avatar
AmberV
Posts: 22035
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Wed Jul 11, 2018 1:12 pm Post

To update on my findings with 10.13.6, I got the same result there: as soon as compile was complete I could resume working in the project with no hangs or slowdowns. I did indeed try several different types of things: typing, selecting, and binder operations. I should note that this was all done on a small 12" laptop, so I don’t think it has to do with resource limits.

The two most interesting aspects (in a mysterious sense):

  • I don’t know if it’s still a problem with 10.13, but in 10.12 large PDF load performance was awful with the stock macOS PDF viewer, exhibiting symptoms much like you describe. If I open a 400 page technical manual in Skim or anything using the macOS PDF viewer, I’m guaranteed a period of non-responsiveness when attempting to select text, scroll, or even move the window around. It’s nowhere near as long as you’re reporting, but interesting in the other similarities. I can’t imagine how it would be related to this to be honest—since Scrivener isn’t opening the PDF you compiled or doing anything with it.
  • Spell check and smart quotes do kind of use the same underlying technology as I understand it. For example we’re aware of a bug whereby sometimes the corrections overlay that macOS provides to text editors will fail. The symptom is that spell check while typing stops working as well as typographic punctuation and other system level substitutions. Since apostrophes are involved, it could be a clue that the spell check engine seems to be the thing consuming the most resources. But why? That’s where it doesn’t make sense—you aren’t using smart quotes from what I saw, and even if you were I don’t think the engine attempts to recalculate the smart quote state in a holistic sense like that—I think it just looks at the local surroundings while you type (probably by line); of what use would it be to update the entire document model?

But that’s why I was wondering if you were using some kind of utility on top of the system that might be doing a bulk analysis of text, like a third-party spell check engine or something. Unfortunately that doesn’t seem to be the case if it happens even in safe mode.

One test I did was to do all of this in a completely fresh Mac account, to test for default settings (many of which I disable, particularly of interest in the System Preferences: Keyboard: Text pane). Nothing was out of the ordinary for me. I wonder if you do the same do you get a fast result? If so that might be a clue—some setting used on both of the Macs you’ve tested that isn’t a default. When I do clean environment tests like this here is how I do it:

  1. Put a zipped copy of the test project into /Users/Shared
  2. Create a new standard Mac account.
  3. Log in to the account and bypass all of the iTunes/iCloud/blah stuff (you have to squint to find the skip functions).
  4. Copy the preprared .zip to the Desktop and extract the .scriv from it.
  5. Launch Scrivener and click through the starting wizard with default settings (no tutorial).

It isn’t a 100% new Mac clean test, I don’t think that is possible. There are some system-wide settings that carry over between accounts or that exist as aspects of the system (such as whether the drive is encrypted with FileVault)—but it’s a pretty clean test.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles

KM
KMRA
Posts: 13
Joined: Wed Jul 04, 2018 6:11 pm
Platform: Mac
Location: Ghent, Belgium and Egham, UK

Wed Jul 11, 2018 3:05 pm Post

I tried what you suggested, running scrivener from a new, clean account, but the problem still occurred -- unless I disabled smart quotes in the system preferences.
Yet, if that's all it takes to make the thing work on my system, I'm happy! :D
Cheers,
Koenraad

User avatar
AmberV
Posts: 22035
Joined: Sun Jun 18, 2006 4:30 am
Platform: Mac + Linux
Location: Santiago de Compostela, Galiza
Contact:

Fri Jul 13, 2018 6:24 pm Post

I remain baffled by the whole thing, but I’m glad to hear you found a way to get things working again! When Keith gets back I’ll forward this information and maybe there will be some clue, but it sounds a bit like a strange macOS thing to me.
.:.
Ioa Petra'ka
“Whole sight, or all the rest is desolation.” —John Fowles