Sublime Forum

Wayland performance issue

#1

On wayland, with GDK_BACKEND=wayland (or the default) cursor movement is slow on a hi dpi 3840x2160 monitor. The behavior is about the same whether hardware_acceleration=“opengl” is turned on or not. I can start with GDK_BACKEND=x11, which fixes the input lag, but makes the window blurry. However, if I run sublime under an actual xorg window manager, the problem goes away: the screen is sharp and input is responsive. Also, the windows version works well on the same monitor.

I am using build 4200 and Fedora 41 workstation edition.

0 Likes

#2

Does the same thing happen for other GTK-based apps? Are you referring to cursor (mouse) movement or caret (text selection) movement?

Blurriness comes from non-integer display scaling, which only Wayland supports. There’s nothing we can do about that, everything running under xwayland is affected.

0 Likes

#3

I’m talking about caret movement then, for example when holding down an arrow key. When the sublime window is larger, it gets slower, as other people have experienced. I think gedit is gtk, and it did well with wayland or x11 as a backend, while nautilus is slow with both, so I haven’t found an app that has the same wayland slowdown.

Also, I should mention that I found a workaround because some wayland compositors allow disabling scaling for xwayland apps, and then I can manually ask for a larger scale with GDK_DPI_SCALE=1.5.

0 Likes

#4

Does it happen in safe mode?

Could you enable fps logging by entering sublime.log_fps(True) into the console (View > Show Console) and share what gets logged when moving the caret around?

0 Likes

#5

Thanks for your quick responses! Yes, it seems to be about the same in safe mode. Here is what the log looks like:

Frame time exceeded 60hz: 22ms
Frame time exceeded 60hz: 22ms
Frame time exceeded 60hz: 26ms
Frame time exceeded 60hz: 21ms
Frame time exceeded 60hz: 22ms
Frame time exceeded 60hz: 23ms
Frame time exceeded 60hz: 22ms
Frame time exceeded 60hz: 21ms
Frame time exceeded 60hz: 21ms
paint events per second: 21.9 average: 21ms
Frame time exceeded 60hz: 20ms
Frame time exceeded 60hz: 21ms
...continued

The paint events per second are consistently between 15-22 when the caret is moving. My key repeat rate is set at 60hz, which may be faster than most, so it’s enough to slow me down. The x11 backend is at 35-45, and doesn’t get the frame time messages.

0 Likes