Sloooow Context Menu...

Hi, I was wondering if I’m the only one who thinks the context menu in an edit view is slower to display in Scrivener than it is in other apps / Finder etc? I get a very perceptible delay between mouse UP (well, two-finger trackpad single-tap END) and when Scrivener shows the context menu, it’s significantly faster in e.g. Textedit. This delay is not present in other context menus in Scrivener (i.e. in the Binder).

I’ve tried turning on/off automatic spelling system wide without any difference. Note I have also made sure my two-finger double-tap Zoom gesture is turned OFF (this slows down context menus system wide as it waits for a double tap before registering the single tap)…

It’s instant for me. Have you got any plugins installed that appear in the contextual menu?

Dropbox is the only top-level app that customises the context menu in Finder. In Scrivener I get the “Search in Google” and “Get current selection” (which is linked to Quicksilver) — I also see these menu items in Apple Pages, which has no delay. I don’t have any input plugins like textexpander.

I’ve tried quitting Quicksilver but it doesn’t affect the context menu lag.

I’ve tried with a new Scrivener document and I also see the delay. I also see the delay on my work machine (a quad core Mac Pro) as well as the Macbook Pro retina I originally reported.

I suppose the next step is try to create a new user account and see if it still persists; any other ideas to try?

Using quicktime screen recording there are 35-37 frames between when the word highlight appears and the context menu appears; recording at 60Hz that is (1/60) * 36 = 0.6 seconds average on my Mac Pro…

Try disabling all of the services that you do not use. You’d do so in the “Shortcuts” tab of the Keyboard System Preference pane. Each service has a checkbox beside it, and you can disable entire groups as well. Reboot after disabling them. I had about a hundred of these on, and was getting super slow response from the contextual menu (about 1.5 seconds), but now it’s close to instantaneous in most software.

I don’t have that many services installed, but even disabling ALL services doesn’t affect the menu lag (still around 0.6 seconds measured empirically), I can upload the video but doubt it will help diagnose much…

I did create a new (standard) test user account and using a new Scrivener project the delay is down to 0.2 seconds. So there is something about my standard user account (on two different machines) that causes Scrivener problems. All I can think of is fonts, at least installing my main writing font (Underware’s Dolly) as either TTF or OTF into the test user account, along with a couple of other fonts doesn’t reproduce the lag. I don’t have stacks of fonts installed, but who knows… I’ll make my way through the other software (SwitchResX and BetterTouchTool are the only menu item apps along with dropbox and quicksilver).

I’ll also try resetting settings and wiping Scrivener preferences.

The case is that this only affects Scrivener, Apple Pages / TextEdit or other writing software / text editors have no lag on the context menu. Even in the new user account, you can tell the difference between Scrivener and Pages for example.

Resetting my Prefs to defaults made no difference. I’ve used Instruments to create 2 sample runs using Scrivener and Pages as I keep right-clicking — run 1 is Scrivener and you can see it making many more calls (320ms in total samples vs. 34ms total for Pages for the single right-click time period I selected):

ShareKitHelper triggered by Scriv uses about 11%CPU along with Scrivener using 20% for that single right-click, Pages uses about 3.5% for the same right-click time period. Scrivener causes more file activity but certainly not MBs of file reads or anything.

The full (zipped) trace file is shared here: db.tt/gDoIoK1p

Right, another update, when I get a context menu for an empty line in the Scrivener editor there is no delay, and Instruments shows very little resource use, and no sharekit helper activity.

Indeed the context menu for a blank line has no “Share” option (and neither does Pages or Textedit):

Screen Shot 2014-06-14 at 20.26.01.png

But the context-menu over text does:

So that “Share” menu is the culprit.

However to add complexity to this, Multimarkdown Composer by Fletcher Penny does have that “Share” submenu and only exhibits a 12 frame (0.2s) delay, and sharekithelper doesn’t exhibit the CPU activity that Scrivener causes.

Anyway I never use that Share menu in Scriviener, is there someway to turn it off?