Sublime Forum

Sublime text slow typing on MacOS

#1

I’ve noticed that a laggyness when typing prose in Sublime on an older mac running HighSierra. Both typing and highlight / editing blocks of text results in a noticeable lag. This assumes normal processor load. Noticed this after update to Sublime Text 4 but not sure if related. I have a couple of packages installed for writing prose: typewriter and MarkdownEditing.

It probably makes sense to revert back to version 3 and seeing if this persists. Can you advise how to downgrade version?

0 Likes

#2

Instructions for that can be found in the post linked below. However, the first things to try would be seeing if the problem also occurs in Safe Mode, and seeing if turning off hardware acceleration has any effect on things.

0 Likes

#3

Thank you for the suggestion. I tried starting up in safe mode but didn’t observe an effect – performance was slow. I also manually disabled packages (prior to running in safe mode) and without effect. I did do some more digging and found a similar issue referenced here: Typing very slow/delayed even on small files. For me too, reducing the text window size affects performance (smaller = faster). But this doesn’t seem to impact other text editors I’ve tried suck as TextEdit so doesn’t seem to be a general issues with MacOS.

Any other suggestions for how to address this? I am running older hardware (Macbook Pro mid 2010) but, again, doesn’t seem to be impacting other text editors and applications.

0 Likes

#4

Did you try turning off hardware acceleration? It’s on by default on MacOS, so starting in Safe Mode would have it enabled, and since you need to restart Sublime after changing the value that’s something that you would need to test separately.

0 Likes

#5

I wasn’t able to find the right configuration file to disable hardware acceleration: in Preference.sublime-settings I see this:
// On Mac, this value is overridden in the platform specific settings.
“hardware_acceleration”: “none”,

But I wasn’t able to find the the platform specific setting file (which I think should be called $packages/User/Preferences (OSX).sublime-settings). I looked in Packages/User and saw and OSX.sublime-keymap but no other OSX config file.

Where else is this being set?

0 Likes

#6

Default/Preferences.sublime-settings includes this:

	// Enables hardware accelerated rendering. This moves rendering to your GPU,
	// allowing for faster rendering at higher resolutions. Changing this
	// setting requires an application restart to take effect.
	// - "none": Performs CPU rendering.
	// - "opengl": Uses OpenGL for rendering. Minimum required version is 4.1
	//
	// On Mac, this value is overridden in the platform specific settings.
	"hardware_acceleration": "none",

Which sets the value of this option to none, but as the comment mentions, this is overridden in the platform specific settings. Platform specific settings are NOT loaded from the User package; there is however a file named Default/Preferences (OSX).sublime-settings that has this content:

{
	"font_face": "Menlo",
	"font_size": 12,
	"scroll_past_end": false,
	"find_selected_text": false,
	"move_to_limit_on_up_down": true,
	"close_windows_when_empty": true,
	"show_full_path": false,
	"hardware_acceleration": "opengl",
	"open_files_in_new_window": "finder_only",
}

When Sublime loads configuration, it always loads the Default files first, and then applies your User settings afterwards. So, in the absence of any preferences in User, on MacOS the defaults are a combination of both of these files (for example, every platform has a different default font, and different platforms have different behavioural defaults, like closing windows automatically when there are no tabs in them on MacOS).

To turn off hardware acceleration, you need to set hardware_acceleration to none explicitly in your User settings and then restart Sublime.

1 Like

#7

Thank you, I think that did the trick: I added that “hardware_acceleration” parameter to the generic User/Preference file. And noticed that the font-face was less “bold” than before and like it was in Sublime 3 (which is nicer to read). And the rendering is faster and doesn’t seem to be affected by window size.

For my reference, could you point to the location of the OSX.sublime-settings file (Default)? I wasn’t able to browse to it within the Application Support/Sublime 3 folder (and don’t see other sublime folders in the directory). Or if there’s another way to identify parameters that are overridden for OSX in case I run into something like this again.

0 Likes

#8

The contents of packages that ship with Sublime don’t appear in the Packages folder; they’re in sublime-package files stored in the Sublime install location. Packages is for user installed packages that for some reason can’t be installed as sublime-package files, your User package, and overrides on packages.

You can use View Package File from the command palette to easily open any packaged file without having to know where or how it’s being stored.

0 Likes

#9

I had similar slowness since upgrading to ST4, where Cmd-Tabbing to the window would sometimes take ~2 seconds to have the window display, or typing and scrolling were sluggish to respond. Disabling hardware acceleration seems to have resolved these issues.

Additional details for my setup:

  • 5 files open, all markdown editors, 2 of the files unsaved
  • about 1500 lines total between them all
  • newer 16" MBP
0 Likes

#10

This is caused by OpenGL contexts getting shuffled between the dedicated and integrated GPUs on (at least) 16” MacBook Pros. Until there is a fix, you can restart Sublime Text after switching GPUs, such as when unplugging an external display.

0 Likes

#11

I frequently slowdowns of Sublime Text on Mac.

What’s the current status of this issue ?

1 Like

#12

Since this is still occurring in 2024, it seems the best thing would be for the installer to default to “hardware_acceleration”: “none”
Worked for me on my MacBookPro M3 Max.

0 Likes

#13

Still happening in March 2024 on MacBook pro 16 Apple M2 Pro with macOS 14.4 (23E214).

My default settings have “hardware_acceleration”: “none” and my user settings have none a part the font.
I don’t have any macOS secific settings.

I tried to add “hardware_acceleration”: “none”, to my user settings but I still have the problem, any suggestion?

0 Likes

#14

Did you restart Sublime after changing the setting?

0 Likes