-
Notifications
You must be signed in to change notification settings - Fork 8.5k
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
Defer cursor redrawing when writing buffer #2960
Defer cursor redrawing when writing buffer #2960
Conversation
To take this further, if we know there will be more |
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
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.
This seems reasonable to me. I'd definitely want @miniksa's thoughts though to be sure
You will probably need to merge in |
7dc6179
to
3d42d9d
Compare
@@ -363,6 +363,8 @@ void Terminal::_WriteBuffer(const std::wstring_view& stringView) | |||
auto& cursor = _buffer->GetCursor(); | |||
const Viewport bufferSize = _buffer->GetSize(); | |||
|
|||
cursor.StartDeferDrawing(); |
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.
Leave behind the comment explaining why this is required (for performance reasons, we can not waste time displaying a cursor event when we know more text is coming right behind it).
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.
I'm fine with this. It looks like (in historical spelunking of our code) that some of the stream writing methods used to hide the cursor for the same reasons and it was lost to the sands of time.
3d42d9d
to
7c6bf96
Compare
Thanks for the contribution! |
🎉 Handy links: |
Thank you for the great job so far. Don't know if it refers to this specific topic, but I'm running ntop in PowerShell and even in the new release (Version: 0.6.2951.0) I can see the cursor jumping up and down the screen while the screen gets refreshed. Shouldn't this be fixed by this pull request? |
Sorta. You're more likely being impacted by #3093 😄 |
Summary of the Pull Request
Defer cursor redrawing when reading buffer
References
#2932
PR Checklist
Detailed Description of the Pull Request / Additional comments
My previous PR #2932 introduces an overhead when writing a lot of text on screen. I found that this could be optimized by delaying cursor redraw
Validation Steps Performed