fix(perf): lazy load un-common dependencies for npm run #87
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I know we avoid lazy loading but I think this case is worthy:
Before:
$ hyperfine --warmup 3 "node ./bin/npm-cli.js run empty" Benchmark 1: node ./bin/npm-cli.js run empty Time (mean ± σ): 197.3 ms ± 3.5 ms [User: 183.1 ms, System: 51.9 ms] Range (min … max): 193.2 ms … 207.5 ms 15 runs
After:
$ hyperfine --warmup 3 "node ./bin/npm-cli.js run empty" Benchmark 1: node ./bin/npm-cli.js run empty Time (mean ± σ): 184.6 ms ± 2.3 ms [User: 170.1 ms, System: 51.1 ms] Range (min … max): 181.6 ms … 190.5 ms 16 runs