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

Use node cached data for node_modules #25229

Closed
jrieken opened this issue Apr 24, 2017 · 5 comments
Closed

Use node cached data for node_modules #25229

jrieken opened this issue Apr 24, 2017 · 5 comments
Assignees
Labels
debt Code quality issues perf
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Apr 24, 2017

Loading node modules is around 20% of loading code and we should look into making that part faster using the trick of code cached data.

@jrieken jrieken self-assigned this Apr 24, 2017
@jrieken jrieken added debt Code quality issues perf labels Apr 24, 2017
@jrieken jrieken added this to the May 2017 milestone Apr 24, 2017
@jrieken jrieken closed this as completed in dcd784e May 4, 2017
@kieferrm kieferrm mentioned this issue May 8, 2017
44 tasks
@csholmq
Copy link

csholmq commented Jun 1, 2017

Any benchmarks of this?

@jrieken
Copy link
Member Author

jrieken commented Jun 1, 2017

Nothing scientific but using cached data speeds up code loading by roughly 50%. JS code from node_modules are around 20-25% of the total code we load at startup. For node_module tho it seems that don't gain that must (maybe because things are scattered in many little files)

Using cached data

screen shot 2017-06-01 at 11 34 16

Not using cached data (but also not generating it)

screen shot 2017-06-01 at 11 34 35

You can see that loading workbench.main.js drops from ~1sec to ~500ms but for node_modules we only drop from ~150ms to ~100ms. Generating cached data (which happens on very first start up) add roughly 15%. Note that these numbers vary from system to system, see them with "F1 > Startup Performance". When refreshing/reloading a page cached data isn't used (for some unknown reason), when starting fresh or creating a new window it is used. Cached data is stored per build, e.g. /Users/jrieken/Library/Application Support/Code - Insiders/CachedData/64d532ccb681ddbef0039db1effa2949f1993214

@csholmq
Copy link

csholmq commented Jun 1, 2017

Alright. So should make some difference with large workspaces. Will test on my machine tomorrow.

@jens1o
Copy link
Contributor

jens1o commented Jun 1, 2017

I'm looking for provide startup performance benchmarks for further improving 😄

@jrieken
Copy link
Member Author

jrieken commented Jun 2, 2017

some difference with large workspaces.

No, that is just about loading JS code which is always the same chunk, independent of the workspace size

@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 18, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debt Code quality issues perf
Projects
None yet
Development

No branches or pull requests

3 participants