Open atruskie opened 1 year ago
I have a similar issue locally, without SSH – running Get-FrequentFolders
takes 350 ms on my laptop, which is very slow, especially when you're supposed to load ZLocation on each PowerShell startup. Is the Quick Access lookup really so valuable from a UX perspective that it makes sense to spend 350 ms on each startup reading it? I'd also support removing it.
For me this happened because an inaccessible network drive was pinned to Quick Access. Or rather, the link became inaccessible after upgrading to Windows 11. Unpinning and pinning it again worked, but it's still slower than without the pin and I don't need it.
Thanks, I wouldn't have found it without your investigation :) For you it's probably also smth about a network link.
Same issue here, profiling (with https://github.com/nohwnd/profiler) shows this as taking 500ms, and looking at the data it grabs it adds no value for me because I don't go to those same folders in commandline (e.g. my profile).
I've noticed that whenever I SSH into a Windows 11 host with Z-Location as part of the profile that it takes 2-3 minutes to load my profile.
I've narrowed it down to Z-Location. Then, still in SSH, I started a new instance of
pwsh -noprofile
and manually ran the steps of theZLocation.psm1
file to narrow down the slow part. The slow parts are:Get-FrequentFolders | ForEach-Object {Add-ZWeight -Path $_ -Weight 0}
which takes 260 secondsGet-FrequentFolders
by itself takes 320 seconds$QuickAccess = New-Object -ComObject shell.application
takes 0.0022 seconds$QuickAccess.Namespace("shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}")
takes 0.012 seconds$QuickAccess.Namespace("shell:::{679f85cb-0220-4080-b29b-5540cc05aab6}").Items()
takes 320 seconds(I'm aware I'm using a slightly older version of z-location but the content of the functions in question are not substantially different)
I've disabled the Get-FrequentFolders part of the powershell module on my remote host and now profile loading is almost instant again.
I don't think the root cause of this issue is to do with Z-Location but rather some sort of COM weirdness within Win32-OpenSSH.
However, it would be nice to optionally disable that the Get-FrequentFolders function. Is that possible?
Other details: