Skip to content
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

Improve extension activation time #2439

Merged
merged 3 commits into from
Oct 27, 2020
Merged

Improve extension activation time #2439

merged 3 commits into from
Oct 27, 2020

Conversation

bwateratmsft
Copy link
Contributor

@bwateratmsft bwateratmsft commented Oct 26, 2020

Fixes #2371.

This covers:

  • Get Docker ID (this is already a one-time penalty, it's cached from then on)
  • Filesystem checks for Docker context paths
  • Setting the VSCode contexts
  • Don't wait on Docker context loading at all?? Can that be done without substantial refactoring?

In the most common case (no Docker contexts, therefore don't need to run CLI), the remaining time spent on activation is mostly dominated (~75%) by Dockerode loading. Nevertheless that will stay as-is; it was an improvement to lazy load the Docker client provider.

@bwateratmsft
Copy link
Contributor Author

Don't wait on Docker context loading at all?? Can that be done without substantial refactoring?

I've looked into it, and I think the answer is no. The real need is for ext.dockerClient to be set, since the activation reason might be any of the commands that use it. The simplest way would be to make ext.dockerClient an AsyncLazy but it has dozens of callers so it would be a significant amount of refactoring.

src/docker/ContextManager.ts Outdated Show resolved Hide resolved
@bwateratmsft bwateratmsft merged commit 28044a4 into master Oct 27, 2020
@bwateratmsft bwateratmsft deleted the bmw/activation branch October 27, 2020 14:09
Dmarch28 pushed a commit to Dmarch28/vscode-docker that referenced this pull request Mar 4, 2021
@microsoft microsoft locked and limited conversation to collaborators Oct 27, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Investigate ways to improve activation time
2 participants