-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Scrolling / moving cursor is slow when GPU is under high load on macOS #6199
Comments
I'm able to reproduce this, but it happens not just for ST but any other app that uses the GPU for rendering including Finder, Safari itself and the compositor (Three-finger swipe up lags). As such I don't think this has anything to do with Sublime Text, but rather macOS and safari letting a web page use up all GPU system resources (especially while the web page isn't in focus). Trying ST3 I'm seeing the same behavior there, though perhaps to a lesser degree. |
Thanks for looking into this.
On my machine, the difference in performance between ST3 and ST4 is huge. Here are two videos comparing the scroll performance while moving the cursor using the down arrow key on a fresh install of both ST3 and ST4 with ST4 running in safe mode. ST3: IMG_5342.mp4ST4: IMG_5343.mp4You can clearly see that while I move the cursor in ST4, the framerate of both the editor and the animation on the right suffers. |
And for comparaison, here's a recording of VSCode : IMG_5344.mp4The cursor animation is not as smooth as ST3, but it's still way better than ST4. Also this is VSCode running mostly out of the box with the LSP activated. If I run my "normal" ST4 setup with LSP on, the framerate drops even further, rendering the editor barely usable. IMG_5345.mp4ST3 runs fine with LSP on: IMG_5348.mp4 |
ST 4165 with the 3D scene running on Win11 behaves nearly the same way as VS Code in your screenshots, but with 3D scene's FPS dropping significantly. Caret moves with inconsistent speed and some pauses in between. But that's happening without regards to current CPU load - even if 3D scene is not running. I know main root cause being discussed here is Mac's compositor, but ... did you make a benchmark with ST4 and LSP disabled? Just asking, because syntax definitions have also changed significantly between ST3 and 4, which may (or may not) be another possible factor for differences. Especially JavaScript makes significant use of "branches". I also noticed lags when moving caret up and down in Python, with some larger branches being involved. To reproduce, just checkout https://github.com/wbond/package_control/blob/four-point-oh/package_control/tests/test_providers.py and move caret over larger |
Yes, these two videos show fresh ST3 / ST4 installs without any plugins running.
|
@deathaxe, does this mean ST4 never has a stable framerate while scrolling or moving the cursor around on your machine? |
Note that branches aren't evaluated when scrolling unless there's a "discontinuity". You'd need to make changes to the file that cause the rest of it to be highlighted differently. Just loading a file fully highlights it from start to finish. If you're seeing this in a freshly loaded file then it can't be related to syntax highlighting. |
I can't reproduce the different behavior you're seeing between ST3 and ST4: macos_intel_performance.mp4Note this is on a 2015 macbook air and hardware acceleration disabled. With hardware acceleration enabled the lag is slightly worse and is noticeable earlier than it is using ST3, but that would be expected given that it uses the GPU for rendering. |
I think this is a really important difference to take into account here. Because both my ST versions are hardware accelerated. Also, in your video, I see that you set the 3D demo On my machine with a more beefy GPU, the So to recap in order to properly replicate my issue:
|
Note that even with |
Ha! OK, so yeah, I guess it makes sense then. |
Console log displays constant 33fps and 2-3ms rendering time, while movig caret downwards. It's just the scrolling speed, which varies or feels like lagging every here and then.
This is also what I have in mind. It just was a subjective impression lags being more noticible in such ranges of code. Moving caret also results in varying scroll speeds with opengl enabled if ST is started and the file just being opened without modifying it. I don't see such effects with "software-rendering", which is what I use most of the time. So that's not a real pain point for me. |
The old rendering pipeline using the gpu buffer is not something we can easily bring back and I don't plan on ever doing so. In light of that I don't think it makes sense to keep this issue open. |
Description of the bug
Scrolling and moving cursor is janky on ST4 when the GPU is under high load.
Here is a comparison between a fresh ST 3211 build and ST 4164 in safe mode:
st4-slow.mp4
I can confirm the problem has been present since the first public build of ST4, scrolling and moving cursor always felt less reactive in general compared to ST3.
Here's the fps log in the console:
Possibly related to #6140?
Steps to reproduce
Expected behavior
Scrolling performance should be identical or at least close to before opening the 3D demo and on par with ST3.
Actual behavior
Scrolling through the document is slow while running the 3D scene in the background.
Navigating with the arrow keys is even slower (looks like 20/30 fps on my machine).
Sublime Text build number
4164
Operating system & version
macOS 13.4.1
(Linux) Desktop environment and/or window manager
No response
Additional information
MacBook Pro
The problem happens when using either only the built-in retina display or using an external 1080p monitor.
OpenGL context information
The text was updated successfully, but these errors were encountered: