-
-
Notifications
You must be signed in to change notification settings - Fork 681
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
Output buffer #374
Output buffer #374
Conversation
Preliminary performance tests have been very promising. Even in debug mode this branch is much more responsive than main. The way I have been testing is that I open two panes and run That being said, this is definitely not a silver bullet, opening something complex like vim and jumping around between files/opening internal UI is still very slow (although still a bit faster than NOTE: I have been testing this on a huge monitor to try and strain things a bit. |
This is very cool :) Initial comments: |
I'm not sure I follow. I would still need to diff them correct? I do like the idea of avoiding iterating over the whole screen each tick, this just seemed easier for a first pass, but maybe I am missing something. |
Or are you thinking of a different route altogether where it is maintaining a list of "pending changes" and the render just becomes flushing those changes out? I think that would be more performant, but probably also more potential for bugs when it gets out of sync? |
Yes, exactly! I think the only things that should get it out of sync are pane/window resizes and tab switches (unless I'm missing something) and thankfully there's another PR open that addresses those cases: #318 We might have to iterate over it a little bit ofc... what do you think? Or would you prefer to merge this solution as a "temporary" solution until we do that? I'm not sure what will be less work. |
I'm game to give it a shot! I'll see if I can pull something together tonight. |
I took at stab at the solution we talked about and I think it is going to be a lot harder than we were expecting. There's a lot of stuff like linewrapping and moving rows that we'd have to duplicate that is not trivial. Pretty much all of the logic in |
Yeah, I see what you mean... as soon as we start scrolling (even just adding a new line) inside a pane, things become a little complex. Right - so let's go with your original solution for now. I think even that alone should give us a pretty nice performance boost. What say you? |
Yeah I think I agree. This solution definitely needs some more fine-tuning first (there's currently some weird issues with first renders I need to sort out) and I want to take another look at it from a performance perspective to make sure there isn't any low-hanging fruit |
Already implemented |
Initial attempt at adding an output buffer so that we don't have to push out all of the changes every render. It's still a draft because there are a few bugs I still need to work out (running
btm
or other programs that use vertical pipes for some reason don't render correctly until after a resize) but I wanted to leave it up here while I work those out to get preliminary feedback.