vors / ZLocation

ZLocation is the new Jump-Location
MIT License
569 stars 29 forks source link

Get-FrequentFolders in ssh session is very slow #134

Open atruskie opened 1 year ago

atruskie commented 1 year ago

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 the ZLocation.psm1 file to narrow down the slow part. The slow parts are:

(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:

MatejKafka commented 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.

VulumeCode commented 9 months ago

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.

nohwnd commented 5 months ago

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).