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

Only iterate panes one time when updating settings #10997

Merged
4 commits merged into from
Aug 23, 2021

Conversation

DHowett
Copy link
Member

@DHowett DHowett commented Aug 20, 2021

The original code for settings reload iterated the entire tree of panes
for every profile in the new settings (O(mn)) and constructed a
TerminalSettings object for every profile even if it later went unused.

This implementation:

  1. Collects all new profiles keyed by guid
    1.a. Adds the "defaults" profile to the map
  2. Iterates every pane, just once, and updates its profile if it shows
    up in the list by GUID.

I've merged all of the per-tab code into a single loop.

Because of 1.a., this code can now update panes that are hosting the
"base" profile.

Copy link
Member

@carlos-zamora carlos-zamora left a comment

Choose a reason for hiding this comment

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

love it

src/cascadia/TerminalApp/TerminalTab.cpp Show resolved Hide resolved
src/cascadia/TerminalApp/Pane.h Outdated Show resolved Hide resolved
Base automatically changed from dev/duhowett/no-profile-guid to main August 23, 2021 17:11
The original code for settings reload iterated the entire tree of panes
for every profile in the new settings, and constructed a
TerminalSettings object for every profile even if it later went unused.

This implementation:

1. Collects all new profiles keyed by guid
1.a. Adds the "defaults" profile to the map
2. Iterates every pane, just once, and updates its profile if it shows
   up in the list by GUID.

I've merged all of the per-tab code into a single loop.

Because of 1.a., this code can now update panes that are hosting the
"base" profile.
@DHowett DHowett force-pushed the dev/duhowett/fix-profile-reload-iteration branch from f852206 to 82aef2f Compare August 23, 2021 17:13
Copy link
Member

@lhecker lhecker left a comment

Choose a reason for hiding this comment

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

Just a nit. Not approving just so it doesn't automerge accidentally.

src/cascadia/TerminalApp/TerminalPage.cpp Outdated Show resolved Hide resolved
@DHowett
Copy link
Member Author

DHowett commented Aug 23, 2021

@msftbot make sure @zadjii-msft signs off

@ghost ghost added the AutoMerge Marked for automatic merge by the bot when requirements are met label Aug 23, 2021
@ghost
Copy link

ghost commented Aug 23, 2021

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'll only merge this pull request if it's approved by @zadjii-msft

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 10992b7 into main Aug 23, 2021
@ghost ghost deleted the dev/duhowett/fix-profile-reload-iteration branch August 23, 2021 19:20
@ghost
Copy link

ghost commented Aug 31, 2021

🎉Windows Terminal Preview v1.11.2421.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
AutoMerge Marked for automatic merge by the bot when requirements are met
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants