-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Duplicating tab is *significantly* slower than new tab #18333
Comments
Do let me know if I can enable some tracing/logging that might help provide more details the next time that I hit upon the slowdown, to help reproduce the issue. |
This is one of those times again where https://superluminal.eu/ would be super helpful... I think as a basic triage you could try and see how fast Windows Terminal launches wsl.exe and OpenConsole.exe, by watching the process tree via https://systeminformer.sourceforge.io/ (or alternatively https://learn.microsoft.com/en-us/sysinternals/downloads/process-explorer). Does it happen instantly? If so, then it's at least quite a bit less likely to be a bug in Windows Terminal. |
My guess is that passing a path to |
I do semi-regularly run into the issue but haven't had it happen while I have the process tree viewer open. I will ping here again if I am able to hit the issue while the viewer is open. At least wrt $ hyperfine 'wsl.exe exit' 'wsl.exe --cd ~ exit' 'wsl.exe --cd / exit' 'wsl.exe --cd /tmp exit' 'wsl.exe --cd /not_exist exit' 'wsl.exe --cd ~/not_exist exit'
Benchmark 1: wsl.exe exit
Time (mean ± σ): 262.8 ms ± 7.1 ms [User: 2.5 ms, System: 0.2 ms]
Range (min … max): 254.5 ms … 278.2 ms 10 runs
Benchmark 2: wsl.exe --cd ~ exit
Time (mean ± σ): 204.3 ms ± 26.0 ms [User: 2.0 ms, System: 0.1 ms]
Range (min … max): 183.1 ms … 261.6 ms 11 runs
Benchmark 3: wsl.exe --cd / exit
Time (mean ± σ): 179.7 ms ± 5.5 ms [User: 1.5 ms, System: 0.5 ms]
Range (min … max): 172.4 ms … 195.1 ms 15 runs
Benchmark 4: wsl.exe --cd /tmp exit
Time (mean ± σ): 176.8 ms ± 4.0 ms [User: 1.7 ms, System: 0.2 ms]
Range (min … max): 171.2 ms … 186.2 ms 16 runs
Benchmark 5: wsl.exe --cd /not_exist exit
Time (mean ± σ): 177.9 ms ± 3.0 ms [User: 1.6 ms, System: 0.1 ms]
Range (min … max): 173.3 ms … 182.6 ms 16 runs
Benchmark 6: wsl.exe --cd ~/not_exist exit
Time (mean ± σ): 177.0 ms ± 3.9 ms [User: 1.6 ms, System: 0.1 ms]
Range (min … max): 172.2 ms … 185.8 ms 16 runs
Summary
wsl.exe --cd /tmp exit ran
1.00 ± 0.03 times faster than wsl.exe --cd ~/not_exist exit
1.01 ± 0.03 times faster than wsl.exe --cd /not_exist exit
1.02 ± 0.04 times faster than wsl.exe --cd / exit
1.16 ± 0.15 times faster than wsl.exe --cd ~ exit
1.49 ± 0.05 times faster than wsl.exe exit These are all within a small factor of each other (more than I would expect due to noise, but not enough to worry about). The behavior I have seen wrt slow-duplicating-tab is literally over a minute of waiting time. |
Is the rest of the UI still interactive while "duplicate tab" is executing /? This'll help us figure out where the issue may be occurring. Also, what other shell integrations do you have set up, if any? |
Yes, rest of the UI is indeed still interactive. More details:
Shell integrations: the Windows Terminal integration is here: https://github.com/jaybosamiya-ms/dotfiles/blob/3a17d8c8bdbcfd3c2cfe743ec185bf46371d50a1/chezmoi/dot_zshrc#L567-L580 ; I know my zshrc is fairly sizable, but most of it (everything other than the WT-specific code that I've linked) should have no impact on tab duplication (it is all highly tested code, used on many machines, over many different terminals, and operating systems, across many years, some including Windows Terminal; by process of elimination, the linked code is the narrowest root cause). |
Windows Terminal version
1.21.3231.0
Windows build number
10.0.26100.0
Other Software
zsh 5.9 (x86_64-ubuntu-linux-gnu)
Steps to reproduce
Expected Behavior
Duplicating a tab should not be faster than opening a new tab and running
cd {prev tab working directory}
Actual Behavior
Duplicating the tab (sometimes) literally takes longer than me re-typing the whole path out by hand.
The text was updated successfully, but these errors were encountered: