Sublime Forum

How to increase Sublime Text frame rate from 60 Hz to 144 Hz

#1

On a 144 Hz monitor, Sublime Text comes out of the box with a mouse wheel or keyboard key scroll that limits screen updates to 60 frames per second. However, if Sublime Text’s scrollbar is clicked by the mouse and dragged up or down, then Sublime Text renders updates to its text view at a full 144 Hz.

How can Sublime Text be made to scroll at 144 frames per second when scrolling with the mouse wheel or a keyboard key?

1 Like

#2

please fix this so i can never use another text editor again. on a 144hz monitor specifically, since the refresh rate is not a multiple of 60, the framerate actually looks very inconsistent like it’s stuttering and lagging.

0 Likes

#3

As far as I know, we don’t have any frame rate limits built in. Which OS are you using and which version of ST? I’ve had no issues with 144hz on Linux.

0 Likes

#4

windows 10 (1909) and sublime 3.2.2 (3211). actually it’s the same on linux for me, and i’ve tried a few different window managers/compositors. same problem described in the original post, smooth scrolling is locked to 60fps but if i manually drag the scrollbar it’ll update at 144.

0 Likes

#5

I’ve confirmed with opengl hardware acceleration using ST4, that we’re rendering at the refresh rate of the monitor. You can use the environment variable LIBGL_SHOW_FPS=1 to confirm. You can enable hardware acceleration on the latest Sublime Merge or Sublime Text 4 using "hardware_acceleration": "opengl". I’m also not able to observe a difference with hardware acceleration turned off. Do you perhaps have a mixed-refresh rate setup? As far as I know the compositor runs at the lowest refresh rate.

0 Likes

#6

Is there a link to ST4 so we can try this out?

1 Like

#7
1 Like

#9

Environment:

  • Windows 10 version 1809.
  • Single monitor.
startup, version: 4074 windows x64 channel: dev

OpenGL Context Information:
  GL API Version: 4.6.0 NVIDIA 445.87
  GLSL Version: 4.60 NVIDIA
  Vendor: NVIDIA Corporation
  Renderer: GeForce GTX 1070/PCIe/SSE2

I am still able to reproduce the issue on this build. Specifically, scrolling a document with the mouse wheel goes at 60 Hz, while clicking and dragging the minimap or scrollbar scrolls at 144 Hz.

Where does the FPS info from LIBGL_SHOW_FPS=1 appear?

0 Likes

#10

LIBGL_SHOW_FPS=1 is for linux. You’d need to run using --multiinstance to run ST in the foreground. Do you see the same behaviour in other applications on windows? It could be that scroll events are being limited to 60hz.

1 Like

#11

chromium and basically everything else runs at a smooth 144fps for me on windows. sublime is the only thing locked to 60. i noticed the caret animation is locked to 60 as well, but when using the scrollbar and “forcing” the screen to update, it looks a lot smoother. i have a single monitor as well and a GTX 970 if it matters. i can’t test the new build as i don’t have a license.

0 Likes

#12

I’ve done some further investigation into this issue on linux. It seems that this is an open issue for GTK and depends on the event frequency from the scrolling device: https://gitlab.gnome.org/GNOME/gtk/-/issues/2025

0 Likes

#13

The same seems to be true of Windows. I’m able to get 70fps when scrolling with my touchpad, which is likely the polling rate.

0 Likes

#14

Nice find. I think that might be a similar but different issue, though.

My mouse’s polling rate is 1000 Hz, and using it to scroll via click-and-drag on the scroll bar does scroll at 144 Hz.

On the other hand, when rolling the scroll wheel one notch, Sublime Text scrolls 3 lines of text in a 60 Hz animation.

Using the page-up and page-down keys on the keyboard also does a scroll animation at 60 Hz.

1 Like

#15

Indeed, there seems to be two issues here: No scroll event interpolation and a fixed animation frame-rate.

0 Likes

#16

Another large contributing factor may be that Sublime Text simply can’t render at the required speed. From testing I can only get it to render quickly enough using CPU rendering with a really small window. This is on linux though.

0 Likes

#17

I have a 144Hz screen now. SublimeText looks quite out of place with respect to all the other applications.

0 Likes

#18

Note this has been fixed for ST4.

1 Like

#19

I just updated to build 4121 and this is a great one, I displayed the FPS and I get consistent 144 fps now where I had more around 80 - 100 FPS before :slight_smile:

(You can use sublime.log_fps(True) to show fps)

1 Like

#20

I’m on 4126 and scrolling is still on 60 fps while on a 144hz display. In contrast, VSC looks abundantly smoother scrolling and caret moving…

0 Likes

#21

Can you post details of your system and enable fps logging as stated above?

0 Likes