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

Activation time is too slow #257

Closed
mtxr opened this issue Sep 21, 2018 · 10 comments
Closed

Activation time is too slow #257

mtxr opened this issue Sep 21, 2018 · 10 comments

Comments

@mtxr
Copy link
Contributor

mtxr commented Sep 21, 2018

Take a look..

image

  • Extension Name: rest-client
  • Extension Version: 0.19.1
  • OS Version: Linux x64 4.4.0-134-generic
  • VSCode version: 1.28.0-insider

We have written the needed data into your clipboard. Please paste:

@Huachao
Copy link
Owner

Huachao commented Sep 21, 2018

@mtxr what is the size of your http file, and does the extension activated very slow when you open the http file each time, like what's the delay from opening the file and seeing the Send Request text?

@mtxr
Copy link
Contributor Author

mtxr commented Sep 23, 2018

I don't remember exactly which file I opened that took 36k ms, but I opened a file like this one below 5 times, activation time was always around 13,5k ms.

@url = *********
@username = ********
@password = *******

###
# @name login
POST {{url}}/auth/password HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json

{
  "username":"********",
  "password":"**********"
}

###
# @name query
POST {{url}}/application/query HTTP/1.1
Accept: application/json, text/plain, */*
Content-Type: application/json
Authorization: Bearer {{login.response.body.$.data.id}}

{JSON DATA}

@Huachao
Copy link
Owner

Huachao commented Sep 29, 2018

@mtxr Sorry for the late reply, I'd like to share with you some progress on this issue. I tested your http file, the average activation time was around 5s. Althought the time seems much smaller than yours, I also think this is a bit unacceptable. I dive into my code, and add some measuring code. I found that the most time-cosing steps are require some 3rd party packages on startup, like request, highlight.js and adal-node, as weel as some global initializtion work like preparing the telemetry client. So I have some ideas about this perf issue:

  1. Defer some packages to be loaded to the actual required time (using techniques like dynamic import)
  2. Make the required 3rd party packages in a small list
  3. Put some global objects initialization tasks to runtime

@pke
Copy link

pke commented Oct 8, 2018

so disabling telemetry (which should be a good citizen and be OFF by default btw) could already improve the performance now?

@Huachao
Copy link
Owner

Huachao commented Dec 28, 2018

@mtxr @pke I have used the Webpack technique in my extension, and it decreases the activation time to less than 1.5s.

@Huachao Huachao closed this as completed Dec 28, 2018
@Huachao
Copy link
Owner

Huachao commented Jan 3, 2019

@mtxr @pke you can try the latest version 0.21.0 to verify this performance issue fix.

@pke
Copy link

pke commented Jan 7, 2019

@Huachao how can I get the performance starts for extensions?

@Huachao
Copy link
Owner

Huachao commented Jan 7, 2019

@pke maybe a built-in command named like Show Running Extensions of VSCode

@pke
Copy link

pke commented Jan 7, 2019

@Huachao 642ms now. Well done!

@mtxr
Copy link
Contributor Author

mtxr commented Jan 7, 2019

@Huachao thank you very much! Great job!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants