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
feat: Smoother render loop #2188
feat: Smoother render loop #2188
Conversation
@9mm, could you test this at some point? There's no hurry, but I wonder if this makes the it possible for you to run with the default settings and vsync enabled, without the need for disabling it and specifying a high refresh rate. |
Absolutely, will check tomorrow morning! |
Ooooo, this definitely is much smoother, if not AS smooth as the other way I was doing it, and this even with animation set to If I use the profiler it looks like it hovers around 65-70 fps, which is much lower than the 120 hz of my screen, but I can say even despite that (somehow?). Also the max hovers around 13-15ms. That is a bit confusing to me though given how smooth everything is, I also checked scrolling. Edit: I think I found why ^ .. it looks like scrolling window is closer to 120 but scrolling through a list in telescope is less than 120, so maybe just item scrolling through a telescope list is maxed out already and thats why it's just as fast visually despite lower frame rate. When scrolling through a long file it hovers around 8.3ms max |
@9mm, that's very good news! On Windows, the news is not as good though. On my work computer it still stutters a lot, even if it was almost smooth on my home computer. I don't think that can be solvable without moving to D3D. |
On Wayland Gnome under VirtualBox VM it's even smoother than current main but more importantly for me this PR solves high CPU usage when unfocused like I already said in #2167 (comment) I have noticed weird issue however, very rarely when I bring back Neovide to the front the window will shrink from maximized state. Profiling would be though as it has happened like three times during the whole workday. |
@mati865, I think this issue might be related to the maximised state bug you are having I have not properly checked what's going on, but I think it's a bug in winit rather than Neovide, since we are not really doing much special. It might also be that winit sends us some window size before the maximized one, and then we send that window size to Neovim, which in turn resizes the window back. But it needs more investigation to fully understand what's going on. |
I do hit #2137 when launching Neovide as the window typically (but not always) starts as a small square-ish box. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
First: Thank you for the PR!
The previous approach caused some unneded polls
The Winit event loop is more optimized now, and it does not really play well with our way of signaling events. It's also one less platform dependent thing.
812c126
to
a1b6194
Compare
Thank you! Chooooooooooooooooooooooooooooooooooooo chooooooooo! 🚂 |
On a roll today 😎 |
Yep, we're getting ready for release! |
What kind of change does this PR introduce?
This makes rendering a little bit smoother, at least on some platforms, and also cleans up and unifies some code.
neovide_refresh_rate
.NOTE: This is functionality complete and can be tested, but depends on, so it's best to not review before that is merged. That's also why it's marked as a draft.
I have also not tested this properly on all platforms, I have only really done testing on Wayland and Windows. So we need testing on macOS and X11 before merging this. I have also only tested the very latest commit on a remote desktop connection to Windows.
Did this PR introduce a breaking change?
A breaking change includes anything that breaks backwards compatibility either at compile or run time.