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

Cache the size viewport structure inside TextBuffer #6841

Merged
3 commits merged into from
Jul 9, 2020

Conversation

miniksa
Copy link
Member

@miniksa miniksa commented Jul 8, 2020

Looking up the size of the viewport from the underlying dimensions of
the structures seemed like a good idea at the time (so it would only be
in one place), but it turns out to be more of a perf cost than we
expected. Not necessarily on any one hot path, but if we sort by
functions in WPR, it was the top consumer on the Terminal side. This
instead saves the size as a member of the TextBuffer and serves that
out. It only changes when it is constructed or resized traditionally, so
it's easy to update/keep track of. It impacted conhost/conpty to a
lesser degree but was still noticeable.

Validation Steps Performed

  • Run time cat big.txt under WPR. Checked before and after perf
    metrics.

PR Checklist

  • Closes perf itch
  • I work here
  • Manual test
  • Documentation irrelevant.
  • Schema irrelevant.
  • Am core contributor.

@miniksa miniksa added Product-Conhost For issues in the Console codebase Area-Performance Performance-related issue Product-Conpty For console issues specifically related to conpty Product-Terminal The new Windows Terminal. Issue-Task It's a feature request, but it doesn't really need a major design. labels Jul 8, 2020
@miniksa miniksa self-assigned this Jul 8, 2020
@miniksa
Copy link
Member Author

miniksa commented Jul 8, 2020

Before:
before cached buffer size

After: (it's just flat out gone, note the absence)
after cached buffer size

@DHowett
Copy link
Member

DHowett commented Jul 8, 2020

oh no, audit mode strikes

@DHowett DHowett added the AutoMerge Marked for automatic merge by the bot when requirements are met label Jul 9, 2020
@ghost
Copy link

ghost commented Jul 9, 2020

Hello @DHowett!

Because this pull request has the AutoMerge label, I will be glad to assist with helping to merge this pull request once all check-in policies pass.

Do note that I've been instructed to only help merge pull requests of this repository that have been opened for at least 8 hours, a condition that will be fulfilled in about 6 hours 32 minutes. No worries though, I will be back when the time is right! 😉

p.s. you can customize the way I help with merging this pull request, such as holding this pull request until a specific person approves. Simply @mention me (@msftbot) and give me an instruction to get started! Learn more here.

@DHowett
Copy link
Member

DHowett commented Jul 9, 2020

@msftbot merge this in 10 minutes

@ghost
Copy link

ghost commented Jul 9, 2020

Hello @DHowett!

Because you've given me some instructions on how to help merge this pull request, I'll be modifying my merge approach. Here's how I understand your requirements for merging this pull request:

  • I won't merge this pull request until after the UTC date Thu, 09 Jul 2020 00:49:29 GMT, which is in 10 minutes

If this doesn't seem right to you, you can tell me to cancel these instructions and use the auto-merge policy that has been configured for this repository. Try telling me "forget everything I just told you".

@ghost ghost merged commit 9e44df0 into master Jul 9, 2020
@ghost ghost deleted the dev/miniksa/perf_buffersize_cache branch July 9, 2020 11:18
@ghost
Copy link

ghost commented Jul 22, 2020

🎉Windows Terminal Preview v1.2.2022.0 has been released which incorporates this pull request.:tada:

Handy links:

This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-Performance Performance-related issue AutoMerge Marked for automatic merge by the bot when requirements are met Issue-Task It's a feature request, but it doesn't really need a major design. Product-Conhost For issues in the Console codebase Product-Conpty For console issues specifically related to conpty Product-Terminal The new Windows Terminal.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants