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
oh-my-zsh on WSL2 has unstable launching speed #4256
Comments
We’ve labelled your issue as ‘need-repro’ since we need more steps to help identify your problem. Could you please provide us with reproducible steps for the issue you’re experiencing, including things such as the specific command line steps necessary to reproduce the behavior and their output. Thank you! -The WSL Team |
Updated original issue with zsh logs and some comparison |
Dropped need-repro out of respect for the effort (thanks). Unfortunately there isn't anything in the zsh logs that jumps out as the source of the problem. I've got one hail mary thing you might try. Create a
You'll need to do a That isn't intended as a "fix" of course, but if the the speed improves with |
After I upgrade to 18936 last week, this issue doesn't seem to happen again. I'll close this issue for now. |
I just wanna say you were so right. I'm so glad it was easy finding my solution to this problem. |
I ran into this same issue today. In my case, it appeared to be related to altering the I did see a small performance boost by removing the sourcing of the oh-my-zsh.sh configuration file, but this was barely perceptible. I used only the suggestion regarding removing the Windows path from WSL ( Also, including the same line in my Windows version: 10.0.19041.1 |
it seems the problem is the PATH variable.
it seems zsh will loop those directories for auto-complete, due to the cross os file system performance issue, this introduced lots of lag.
|
I think the windows path would be useful when we need interop. For examples, use code.exe , explorer.exe in WSL. |
@anderswei The same path is on |
I want zsh do auto-complete for windows path ,but just don't do it at start up , what should I do ?? |
@eromoe you can just add an export for your
The above add |
@Martichou Not that problem, I commented those paths , however it is still slow . |
@eromoe Declare functions that call these executables |
When auto mount is disable wholed c mount is removed from the wsl so how can we access the code . of the windows? |
Your Windows build number:
10.0.18922.1000
What you're doing and what's happening:
Installed oh-my-zsh, the launch speed of an Ubuntu terminal becomes unstable.
What's wrong / what should be happening instead:
So after I upgrade Ubuntu instance to WSL-2, I found the launch speed of oh-my-zsh became even worse -- around 5 seconds.
Other options I have tried include install a new instance, launching zsh without oh-my-zsh.
With a new instance, launch speed was good (likely 1~2 seconds) at the beginning, but after one day of normal PC use (no heavy WSL use), it became slower and slower (around 5 seconds).
Launching zsh without oh-my-zsh is always as good as bash without any configurations.
Does this mean there is some bottleneck for reading all the configuration and resource files for oh-my-zsh?
some_command
is failing, then runstrace -o some_command.strace -f some_command some_args
, and link the contents ofsome_command.strace
in a gist here).Not sure what to get, but I'll try when I got time.
EDIT:
After one day I reinstalled oh-my-zsh, it took around 3s to load everything.
I added a line in
.zshrc
so it can print timestamps while zsh is loadingSo when I installed oh-my-zsh, I printed out the log and save it to a file named
fast_log.txt
, then I turned the printing off by commenting the line above in.zshrc
. Today, when I found it got slow, I turn the printing on and grabbed the log three times when I tried to launch zsh three times. I saved them into slow_log.txt, slow_log_2.txt and slow_log_3.txt.I also write a little script to compare fast and slow logs, it turned out there are a few steps in the slow log that take >0.1s more than those steps in the fast log.
They are:
The first column is a line number in fast_log.txt, second column is the time difference between fast_log and slow_log, third and forth are fast latency and slow latency for that step, last column is the traced step.
zsh logs are here: https://gist.github.com/MichaelTong/5626016120be35c250a2c1e0fdd7b449
The text was updated successfully, but these errors were encountered: