-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Performance improvements to load times of extension #931
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
Conversation
@@ -134,21 +131,14 @@ export class InterpreterService implements Disposable, IInterpreterService { | |||
return false; | |||
} | |||
if (activeWorkspace.configTarget === ConfigurationTarget.Workspace) { | |||
return !await this.isPythonPathDefined(pythonPathInConfig!.workspaceValue); | |||
return pythonPathInConfig!.workspaceValue === undefined || pythonPathInConfig!.workspaceValue === 'python'; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@MikhailArkhipov
I reverted the change you made. I've added a catch
in display/index.ts
which would handle cases where interpreter is invalid (does not exist).
This fs check alone takes over 1.5 seconds on my Mac.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Single file existence check? Wow.
|
||
@injectable() | ||
export class PipEnvService implements IInterpreterLocatorService { | ||
export class PipEnvService extends CacheableLocatorService { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Modified to inherit CacheableLocatorService
.
Something I should have picked up during code review, my fault.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah I thought about cacheable too
Codecov Report
@@ Coverage Diff @@
## master #931 +/- ##
==========================================
- Coverage 64.07% 63.99% -0.09%
==========================================
Files 260 260
Lines 12044 12020 -24
Branches 2134 2132 -2
==========================================
- Hits 7717 7692 -25
- Misses 4318 4319 +1
Partials 9 9
Continue to review full report at Codecov.
|
(improvements from ~2.5s to under 200ms)
Fixes Improve extension load time #929