Performance: slow first run and slow new tab opening when lot of profiles #10889

Closed
opened 2026-01-31 02:32:55 +00:00 by claunia · 15 comments
Owner

Originally created by @kszymukowicz on GitHub (Oct 3, 2020).

Originally assigned to: @PankajBhojwani on GitHub.

Environment

Windows build number: 10.0.19041.508
Windows Terminal version): 1.4.2652.0

Steps to reproduce

Add lot of profiles. At least 200. (my case is 190)

Expected behavior

Opening of WT and opening new tabs should be fast.

Actual behavior

Opening WT takes like 2-3sec. Opening the new tab also takes 2-3sec. The same with closing tabs.
When I have few profiles everything is super fast.

Hardware config if someone thinks its question of power: Ryzen 7 4800H, 32GB RAM.

Originally created by @kszymukowicz on GitHub (Oct 3, 2020). Originally assigned to: @PankajBhojwani on GitHub. # Environment ``` Windows build number: 10.0.19041.508 Windows Terminal version): 1.4.2652.0 ``` # Steps to reproduce Add lot of profiles. At least 200. (my case is 190) # Expected behavior Opening of WT and opening new tabs should be fast. # Actual behavior Opening WT takes like 2-3sec. Opening the new tab also takes 2-3sec. The same with closing tabs. When I have few profiles everything is super fast. Hardware config if someone thinks its question of power: Ryzen 7 4800H, 32GB RAM.
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2020):

Well, the "opening a new tab" case is certainly interesting. Not sure why that would be slower with that many profiles. As far as the startup delay goes, that's being tracked over in #7791.

Do new all new tabs take a long time to open, or is it specific to certain profiles? Is there any difference between cmd, powershell, wsl profiles?

@zadjii-msft commented on GitHub (Oct 5, 2020): Well, the "opening a new tab" case is certainly interesting. Not sure why that would be slower with that many profiles. As far as the startup delay goes, that's being tracked over in #7791. Do new all new tabs take a long time to open, or is it specific to certain profiles? Is there any difference between cmd, powershell, wsl profiles?
Author
Owner

@kszymukowicz commented on GitHub (Oct 5, 2020):

  1. No difference between cmd, powershell, wsl profiles - the same lag.
  2. The lag is when:
    a) opening application
    a) later when clicking "plus" icon (or by ctrl+shift+d)
    b) later when clicking close tab button
@kszymukowicz commented on GitHub (Oct 5, 2020): 1. No difference between cmd, powershell, wsl profiles - the same lag. 2. The lag is when: a) opening application a) later when clicking "plus" icon (or by ctrl+shift+d) b) later when clicking close tab button
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2020):

Oh jeez do we do something contrived when the user clicks the new tab button to figure out which of the profiles is the default profile? I'll leave this open to investigate, thanks!

@zadjii-msft commented on GitHub (Oct 5, 2020): Oh jeez do we do something contrived when the user clicks the new tab button to figure out which of the profiles is the default profile? I'll leave this open to investigate, thanks!
Author
Owner

@kszymukowicz commented on GitHub (Oct 5, 2020):

"do we do something contrived when the user clicks the new tab button to figure out which of the profiles is the default profile" - but why its slow on closing tab also? I suppose you do not need to know default profile when you close tab.

@kszymukowicz commented on GitHub (Oct 5, 2020): "do we do something contrived when the user clicks the new tab button to figure out which of the profiles is the default profile" - but why its slow on closing tab also? I suppose you do not need to know default profile when you close tab.
Author
Owner

@zadjii-msft commented on GitHub (Oct 5, 2020):

That's a really good question. By all accounts, there's no reason that there's any logic associated with closing a tab that should scale with the number of profiles. That's just madness.

@zadjii-msft commented on GitHub (Oct 5, 2020): That's a really good question. By all accounts, there's no reason that there's any logic associated with closing a tab that should _scale with the number of profiles_. That's just madness.
Author
Owner

@DHowett commented on GitHub (Oct 5, 2020):

Moving this forward to 1.5. Reproduced open, close, exit and launch delay with 100 profiles.
Good lord.

(1..100) | %{ "{`"name`":`"$_`"}," } | set-clipboard

powershell snippet that puts 100 profile blobs on your clipboard for pasting into WT.

@DHowett commented on GitHub (Oct 5, 2020): Moving this forward to 1.5. Reproduced open, close, exit and launch delay with 100 profiles. Good lord. ``` (1..100) | %{ "{`"name`":`"$_`"}," } | set-clipboard ``` powershell snippet that puts 100 profile blobs on your clipboard for pasting into WT.
Author
Owner

@DHowett commented on GitHub (Oct 5, 2020):

@zadjii-msft

>	TerminalApp.dll!winrt::TerminalApp::implementation::TerminalPage::_UpdateCommandsForPalette() Line 2175	C++
 	TerminalApp.dll!winrt::TerminalApp::implementation::TerminalPage::_OnTabItemsChanged(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Windows::Foundation::Collections::IVectorChangedEventArgs & eventArgs) Line 1946	C++

BIG OLE LOOP

@DHowett commented on GitHub (Oct 5, 2020): @zadjii-msft ``` TerminalApp.dll!winrt::TerminalApp::implementation::TerminalPage::_ExpandCommands(winrt::Windows::Foundation::Collections::IMapView<winrt::hstring,winrt::TerminalApp::Command> commandsToExpand, winrt::Windows::Foundation::Collections::IVectorView<winrt::TerminalApp::Profile> profiles, winrt::Windows::Foundation::Collections::IMapView<winrt::hstring,winrt::TerminalApp::ColorScheme> schemes) Line 2163 C++ > TerminalApp.dll!winrt::TerminalApp::implementation::TerminalPage::_UpdateCommandsForPalette() Line 2175 C++ TerminalApp.dll!winrt::TerminalApp::implementation::TerminalPage::_OnTabItemsChanged(const winrt::Windows::Foundation::IInspectable & __formal, const winrt::Windows::Foundation::Collections::IVectorChangedEventArgs & eventArgs) Line 1946 C++ ``` BIG OLE LOOP
Author
Owner

@zadjii-msft commented on GitHub (Oct 6, 2020):

oh no, I was the murderer the whole time -.-

Wait, does that even do anything? Did I leave that there as a "maybe some day we'll want to be able to expand commands on tabs", but we don't currently, but we still regenerate the list of commands? Oh lawd that's so bad

@zadjii-msft commented on GitHub (Oct 6, 2020): oh no, I was the murderer the whole time -.- Wait, does that even _do anything_? Did I leave that there as a "maybe some day we'll want to be able to expand commands on `tabs`", but we don't currently, but we still regenerate the list of commands? Oh lawd that's so bad
Author
Owner

@ghost commented on GitHub (Oct 10, 2020):

I have a question, I don't know if I should open a new issue for it:
How does the terminal team monitor performance regressions, particularly startup performance regressions?

@ghost commented on GitHub (Oct 10, 2020): I have a question, I don't know if I should open a new issue for it: How does the terminal team monitor performance regressions, particularly startup performance regressions?
Author
Owner

@Don-Vito commented on GitHub (Dec 10, 2020):

@zadjii-msft, @PankajBhojwani - is this one still relevant? I believe it was resolved

@Don-Vito commented on GitHub (Dec 10, 2020): @zadjii-msft, @PankajBhojwani - is this one still relevant? I believe it was resolved
Author
Owner

@kszymukowicz commented on GitHub (Dec 10, 2020):

Yes. Its ok now.

@kszymukowicz commented on GitHub (Dec 10, 2020): Yes. Its ok now.
Author
Owner

@kczx3 commented on GitHub (May 26, 2021):

What is the expected startup time exactly? I only have 4 profiles but it takes like 3-4 seconds just for the window to appear. I'd argue everything should be done to make the window appear as fast as possible even if that means the profile and console load time is perceived to be slower then.

@kczx3 commented on GitHub (May 26, 2021): What is the expected startup time exactly? I only have 4 profiles but it takes like 3-4 seconds just for the window to appear. I'd argue everything should be done to make the window appear as fast as possible even if that means the profile and console load time is perceived to be slower then.
Author
Owner

@DHowett commented on GitHub (May 26, 2021):

definitely not that long. if you run wsl -l is it slow?

@DHowett commented on GitHub (May 26, 2021): _definitely not that long_. if you run `wsl -l` is it slow?
Author
Owner

@kczx3 commented on GitHub (May 26, 2021):

Less than a second running that command from cmd.

@kczx3 commented on GitHub (May 26, 2021): Less than a second running that command from cmd.
Author
Owner

@kczx3 commented on GitHub (May 27, 2021):

I suppose my problem is somewhat different because it isn't just on first run. It is on any load really. I have a bunch of shortcuts that launch a new-tab with a command line to launch into ssh and it takes about 4 seconds for those too.

@kczx3 commented on GitHub (May 27, 2021): I suppose my problem is somewhat different because it isn't just on first run. It is on any load really. I have a bunch of shortcuts that launch a new-tab with a command line to launch into ssh and it takes about 4 seconds for those too.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/terminal#10889