Fix windows path locator performance.#15177
Fix windows path locator performance.#15177ericsnowcurrently merged 34 commits intomicrosoft:mainfrom
Conversation
c46b693 to
1ecc352
Compare
|
I think we can simplify this, when we are looking for things in PATH we are anyway going to look for This way we will have the fast detection of anything that is common, and eventual detection of anything that is uncommon python executable pattern. |
|
I agree with @karthiknadig, if we're just looking for
This practically never finishes, it'll eventually hang the extension. So we cannot have this running even in background until we find the fix. |
|
Removing my review until this is ready to be reviewed again. |
|
Accidently closed it, sorry. |
|
@karthiknadig, @karrtikr, I've updated the PR to deal with the quirks on Windows. Now we do not watch Windows\system32 and we avoid unnecessary |
src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts
Outdated
Show resolved
Hide resolved
src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts
Outdated
Show resolved
Hide resolved
src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts
Outdated
Show resolved
Hide resolved
karrtikr
left a comment
There was a problem hiding this comment.
My stance is we should remove all watchers for windows path locator for now. We can add this as an enhancement later if necessary.
src/client/pythonEnvironments/base/locators/lowLevel/windowsKnownPathsLocator.ts
Outdated
Show resolved
Hide resolved
|
There is no need to watch for files on PATH. We don't do that now, This can be expensive on slower machines. We also don't for other platforms. |
|
If we are just copying over the old behavior then I'm fine with dropping the watcher stuff. However, my understanding was that we were implementing the new discovery code in the proper way, regardless of how we were doing it before. |
51e095d to
caa4c05
Compare
|
In the interest of getting this wrapped up sooner rather than later, I'll drop the watcher stuff for now. |
karrtikr
left a comment
There was a problem hiding this comment.
I understand significant work has been done but we should remove the code introduced with this PR which is no longer used in fixing windows path locator performance. We can add that code back later if and when we need to use it. Other than that, LGTM.
src/client/pythonEnvironments/base/locators/lowLevel/filesLocator.ts
Outdated
Show resolved
Hide resolved
src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts
Outdated
Show resolved
Hide resolved
src/client/pythonEnvironments/base/locators/lowLevel/fsWatchingLocator.ts
Outdated
Show resolved
Hide resolved
…aries() more focused.
35c0c3d to
1040ca2
Compare
Codecov Report
@@ Coverage Diff @@
## main #15177 +/- ##
======================================
- Coverage 64% 64% -1%
======================================
Files 558 558
Lines 26656 26716 +60
Branches 3851 3854 +3
======================================
+ Hits 17315 17353 +38
- Misses 8634 8649 +15
- Partials 707 714 +7
|
|
@karthiknadig ETA on a review? |
|
@karrtikr, FYI, I tried my branch on my Windows laptop and it worked fine. However, I recall that this impacted other people more than it did me. Would you mind trying it out, just to double-check? |
|
@ericsnowcurrently Yeah okay I'll try it out. |
|
@ericsnowcurrently Works for me 👍 Although I see that the paths discovered by this locator are lowercased so they appear to be different than the others. |
Great! Thanks!
Hmm, I don't see anything in the PR that might have caused either behavior directly (other than maybe the glob code). I'll open an issue to investigate. |
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #15177 +/- ##
======================================
- Coverage 64% 64% -1%
======================================
Files 558 558
Lines 26656 26716 +60
Branches 3851 3854 +3
======================================
+ Hits 17315 17353 +38
- Misses 8634 8649 +15
- Partials 707 714 +7
🚀 New features to boost your workflow:
|

The fix here is to use a timeout. When we hit it (with large directories like
\windows\system32), we fall back to trying some known Python executables.[ ] Has telemetry for enhancements.[ ] The wiki is updated with any design decisions/details.