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

Investigate ways to improve activation time #2371

Closed
bwateratmsft opened this issue Oct 5, 2020 · 3 comments · Fixed by #2439
Closed

Investigate ways to improve activation time #2371

bwateratmsft opened this issue Oct 5, 2020 · 3 comments · Fixed by #2439

Comments

@bwateratmsft
Copy link
Contributor

bwateratmsft commented Oct 5, 2020

We've just done a significant amount of improvement to code loading time. We should also see what can be done about activation time.

At the time of writing, for 1.6.0 the avg activation times are 278 ms for Linux, 388 ms for Mac, 541 ms for Windows. I'd like to get Windows (and the rest) below 200 ms if at all possible.

@bwateratmsft bwateratmsft changed the title Investigate ways to improve code loading time Investigate ways to improve activation time Oct 5, 2020
@bwateratmsft
Copy link
Contributor Author

bwateratmsft commented Oct 12, 2020

I've done some investigating. On my (Windows) machine, the biggest delay is from docker context ls, unsurprisingly; about 600ms. Other slowish points were the calls to setVsCodeContext (about 20ms each), loading the Dockerode API (obviously needed otherwise it's less-efficient code loading time), and the filesystem checks for ~/.docker/....

We can make the calls to setVsCodeContext no longer wait. In fact we can probably make the entire loading of DockerContextManager not wait, since anything actually using it will be held up by the lazy-loading anyway. If we do this, at least the language server and debug/etc. providers will be set up more quickly.

Also worth considering is trying to call the Docker SDK to load the contexts if possible, however it does not include the host at this time which is needed to make Dockerode work.

@bwateratmsft bwateratmsft added this to the 1.8.0 milestone Oct 14, 2020
@bwateratmsft bwateratmsft self-assigned this Oct 14, 2020
@bwateratmsft
Copy link
Contributor Author

bwateratmsft commented Oct 26, 2020

The activation time is dominated by several things:

Things we can maybe improve:

  • 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??

Things we cannot improve at this time:

  • Docker CLI call for Docker contexts
  • Dockerode client loading (we removed it from code loading to put it here as lazy, overall it's a win)

@bwateratmsft
Copy link
Contributor Author

This fix has now been released in 1.8.0.

@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 11, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant