Sublime Forum

Lag/stutter when moving cursor in macOS Tahoe (26)

#1

New thing started happening since MacOS Tahoe I believe (in ST4 4199).

When I hold j or k to move the cursor up and down (NeoVintageous), it constantly stutters, sometimes getting stuck and eventually jumping multiple lines. It was the smoothest thing ever before. No changes to anything (same plugins, configs). I’m on MacBook Pro M1 Max with 64GB ram, using external 5k LG UltraFine monitor (if that’s relevant).

Some observations so far:

  1. The issue happens in both NeoVintageous’ and Vintage’s “normal mode”. (I tried disabling one, enabling the other, same issue).
  2. The issue seems gone when switched to “insert mode”, and using arrow keys, with either plugin.
  3. The issue persists if I use arrow keys, but stay in “normal mode”.
  4. The issue seems gone when both vim plugins are disabled.
  5. I see that while holding any movement button (h/j/k/l or arrows), CPU usage jumps to 99.8%. Not sure if that was always the case however.

Wonder if that’s just me…

To reproduce

Open any file with some code, make sure you’re in normal mode in vim emulation, and just keep alternating between holding j and k, seeing the cursor move up and down.

Here’s normal mode demo:
output1

Here’s insert mode demo:
output2

0 Likes

#2

Is it the main process or the plugin host subprocess whose CPU usage jumps?

0 Likes

#3

@bschaaf It’s Sublime Text process itself.

P.S. Added demo gifs above. Both at 30fps, enough to show stutter.

0 Likes

#4

Could you open Activity Monitor, select the Sublime Text process and run “Sample Process” and while that’s running move the caret up/down in normal mode?

0 Likes

#5

Here’s what I managed to get. Sample process is very short, but I’m sure I caught cursor movement in it.

0 Likes

#6

Just now, the issue got so bad, that I don’t even see the cursor move until I release the key. And when I release it, it jumps all the way to the top/bottom of the file.

0 Likes

#7

I restarted ST4, and the issue is gone. Wonder if it comes back.

0 Likes

#8

It’s back again, after a couple of days.

0 Likes

#9

Unfortunately I wasn’t able to find anything in the sample. I’m not sure whether that’s because it wasn’t captured right, or whether the high CPU is unrelated to our code. It’s very odd that it only happens in normal mode.

You could try profiling with Instruments, but that’s a fair bit more involved.

0 Likes

#10

@bschaaf I could try to capture a more helpful sample. Could you tell me approximately what kind of stuff you’re trying to find in it?

0 Likes

#11

maybe relevant:

0 Likes

#12

I was thinking about that too, notably Slack and 1Password are the 2 offenders here. I believe I tried quitting Slack/1P and seeing if the issue persists, and it still did, but I’m not 100% certain, so will check that next time too.

P.S. Using this script to detect offenders.

0 Likes