This repository has been archived by the owner on May 4, 2024. It is now read-only.
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.
This is a very risky PR since it could break a lot of things but I think it is worthy to have.
The loading graph before:
The loading graph after:
The loading time using hyperfine before:
$ hyperfine --warmup 3 "node ./lib/log.js" Benchmark 1: node ./lib/log.js Time (mean ± σ): 114.9 ms ± 1.7 ms [User: 101.4 ms, System: 37.9 ms] Range (min … max): 111.9 ms … 117.6 ms 25 runs
After:
$ hyperfine --warmup 3 "node ./lib/log.js" Benchmark 1: node ./lib/log.js Time (mean ± σ): 104.1 ms ± 2.0 ms [User: 91.6 ms, System: 34.4 ms] Range (min … max): 98.1 ms … 108.5 ms 29 runs
I also added another method called
trackerRemoveAllListeners
that can be used to never load theare-we-there-yet
at https://github.com/npm/cli/blob/latest/lib/utils/display.js#L114I think we should add more tests to
gauge
and also fortracker
that didn't include mocked versions since I didn't even declaretracker
andgauge
during the tests and it passed all the tests because they are mocked.