Skip to content
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 text buffer line painting #3232

Closed

Conversation

skyline75489
Copy link
Collaborator

@skyline75489 skyline75489 commented Oct 17, 2019

Summary of the Pull Request

Defer painting when writing a lots of text.

References

#2960 #3075

PR Checklist

  • Closes #xxx
  • CLA signed. If not, go over here and sign the CLA
  • Tests added/passed
  • Requires documentation to be updated
  • I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan. Issue number where discussion took place: #xxx

Detailed Description of the Pull Request / Additional comments

Calling NotifyPaint for every line is expensive and not really necessary. For performance reason, painting should wait for as much buffer as possible.

Validation Steps Performed

Comment on lines +350 to +352
const auto written = it.GetCellDistance(givenIt);
const Viewport paint = Viewport::FromDimensions(target, { gsl::narrow<SHORT>(written), 1 });
_NotifyPaint(paint);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this not work if the write wraps to the next line? This looks to me like it'll only invalidate the region of the buffer on the initial line, and none of the subsequent lines.

@zadjii-msft zadjii-msft added the Product-Conhost For issues in the Console codebase label Oct 25, 2019
@skyline75489
Copy link
Collaborator Author

It occurs to me that the code base here is doing a lot of paint while writing buffer. Every cell calls NotifyPaint, whick makes render thread and terminal connection thread competing for CPU resource. This isn't right. The paint should be delayed as described in #3075. But I don't know how to achieve it without breaking a lots of things...

@skyline75489
Copy link
Collaborator Author

I'm gonna close this one in favor of #780. Hope it can land soon.

@skyline75489 skyline75489 deleted the fix/deferCellPaint branch November 5, 2019 09:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Product-Conhost For issues in the Console codebase
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants