This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
接受
或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
发布评论
评论(1)
通常我会怀疑你的个人资料——这就是几年前我从 Zsh 转向 Fish 的原因。但鉴于您的评论:
......这显然与 shell 无关。但是,如果 WSL1 整体速度变慢,那么您可以采取的任何措施来优化您的 shell 配置肯定会有助于解决您提到的一些问题。 OMZ 可能会加剧回购中
cd
的延迟。但这显然只是症状,而不是根本原因。作为比较,我的 Ubuntu 20.04 WSL1 在带有磁存储的 12 年旧台式机上的启动时间约为 6 秒。
至于解决速度下降问题,我发现当在 WSL1 rootfs 上启用基于访问的防病毒检查时,性能会显着下降。即使在我最近使用 SSD 的中高端台式机上,我仍然将所有 WSL1 目录保留在防病毒软件的排除列表中。
是否可能有新的防病毒更新与您提到的 Windows 更新一起推送到您的系统?
希望您有足够的访问权限来添加自己的防病毒排除项。您通常可以在以下位置找到 WSL1 rootfs:
会有所不同 - Ubuntu 通常以Canonical...
开头。请注意,防病毒问题是 WSL1 所特有的。由于它的文件系统对 Windows 是“可见的”,因此它会被扫描。 WSL2 虚拟驱动器没有得到相同的待遇。
Normally I'd suspect your profile -- That's the type of thing that moved me from Zsh to Fish a few years ago. But given your comment that:
... that's obviously not shell related. However, if WSL1 as a whole is slowing down, then anything you can do to optimize your shell config will certainly help with some of the issues you cite. The delays in
cd
'ing in repos is likely being aggravated by OMZ. But that's clearly symptomatic here, not the root cause.For comparison, my Ubuntu 20.04 WSL1 startup time on a 12-year old desktop with magnetic storage is about 6 seconds.
As for troubleshooting the slowdown, I've seen significant performance decreases when access-based antivirus checks are enabled on the WSL1 rootfs. Even on my recent, mid-to-high-end desktop with SSD, I still keep any WSL1 directories in the Exclusions list of the antivirus.
Could there have been a new anti-virus update pushed to your system along with the Windows update you mentioned?
Hopefully you have enough access to add your own anti-virus exclusions. You can typically find your WSL1 rootfs under:
The
<distropackage>
will vary -- Ubuntu typically starts withCanonical...
.Note that the anti-virus issue is unique to WSL1. Since its filesystem is "visible" to Windows, it gets scanned. WSL2 virtual drives do not get the same treatment.