Sublime Forum

10% CPU usage when moving cursor inside Sublime 4?

#1

I accidentally noticed that if you move the cursor in the Sublime Text 4 window, it loads the processor by 10%. If someone can, please test it on your machine (ive tested on Mac OS monterey). Open the system monitor on the side, and at the same time move the cursor around in Sublime.
I noticed this only in version 4; I tried it in version Sublime 3 and there was no such CPU usage there it was 0.3-0.5%.

If I don’t move the cursor, Sublime consumes about 0.9%. As soon as I start moving it, usage jumps to 10%. That’s a lot. For example, Karabiner-Elements on macOS, which reprograms everything related to the keyboard, trackpad, and mouse, only uses about 1.5% while tracking cursor movement. So for Sublime to take 10% seems quite high and not really optimized, if that’s indeed how it’s supposed to work in version 4.

Even if the window is empty, no plugins are installed, and the theme is default, moving the cursor noticeably consumes CPU.
Is it possible to disable this?

I’ve tried settings:
“mini_map”: false,
“highlight_line”: false,
“match_brackets”: false,
“match_brackets_content”: false,
“auto_complete”: false
Also tried setting gpu: none and restarting, but it still consumes resources even in an empty document.

Sublime Text 4200

macOS Monterey
Version 12.7.6
MacBook Pro (Retina, 15-inch, Mid 2015)
Processor 2.2 GHz Quad-Core Intel Core i7
Memory 16 GB 1600 MHZ DDR3
Graphics Intel Iris Pro 1536 MB

Here I’m moving the cursor in an empty Sublime Text 4 window, and the system monitor is running on the side.

0 Likes

#2

This is going to need more information:

  1. Exact Sublime version.
  2. OS and version.
  3. Any packages installed.
0 Likes

#3

ssory added info above

I tried it on a clean Sublime 4 as well, and the result is the same — with or without plugins, there’s no difference.
Just when moving the mouse inside the Sublime window, the CPU usage goes up to 10%.

0 Likes

#4

Does it still happen in safe mode?

0 Likes

#5

@qweewert Have you tried setting the following under Sublime Text 4?

“hardware_acceleration”: “opengl”

This will enable the hardware acceleration of the rendering, worth checking out. The none setting has the editor using software rendering mode. If your MAC has a good graphics card it can help with the text rendering.

Have you tried setting the new settings for plugins to run through Python 3.8 instead of Python 3.3. May be worth trying it with the setting on and off, in case it has a positive effect or a negative one.

Please report back after trying the above.

0 Likes

#6

Hardware acceleration is enabled by default on macOS. You don’t need a good graphics card to see the benefits from hardware acceelrated rendering, anything produced in the last decade would work.

The best way to check if plugins are a problem is to run in safe mode. Though plugins don’t get mouse movement events, so it doesn’t make much sense that they would be at fault.

0 Likes

#7

Yes

There it is in safe mode…

0 Likes

#8

I’m able to reproduce this issue, but on further investigation that CPU usage is spent primarily inside cocoa (macOS UI framework). Testing other applications like Finder and Safari shows the same behavior, on my system both of them have a higher energy impact when moving the mouse around than Sublime Text. So to me this looks like an issue with macOS.

1 Like

#9

I don’t see Cocoa consuming resources extra resources, but I clearly see that Sublime consumes an additional 10% on top of the operating system’s consumption when moving the cursor across its window.

FINDER


SAFARI

0 Likes

#10

subl --safe-mode

0 Likes

#11

"I tried both enabling and disabling GPU rendering in the settings, and also tried safe mode - it consistently consumes 7-10%. Sublime Text 3 doesn’t have this issue, and it’s also on Cocoa.**

"It would be really great if people on macOS could test this on their systems and check if they also get the same consumption when moving the cursor around an empty Sublime window. 7-10% is a lot."

0 Likes

#12

"You’re right. If you run any application as the main one and move the cursor over its active window, it consumes approximately the same amount of resources as Sublime. I didn’t notice this before because only Sublime catches the interaction when it’s below Activity Monitor. Usually monitoring is always on top of other applications."

0 Likes