Skip to content

Speed up global list command#5148

Merged
arcanis merged 5 commits intoyarnpkg:masterfrom
bestander:no-global-scripts
Jan 15, 2018
Merged

Speed up global list command#5148
arcanis merged 5 commits intoyarnpkg:masterfrom
bestander:no-global-scripts

Conversation

@bestander
Copy link
Copy Markdown
Member

@bestander bestander commented Jan 3, 2018

Summary

Fixes #4465

global list command is a bit lazy - it gets the number of installed dependencies by running a full install.
The original solution is not really nice because global list relies on internal implementation of install.js and package-resolver.js.
But this should help a bit.

Test plan

Speedup 4x if scripts don't reinstall.

[20:34:39] bestander:~/work/yarn (no-global-scripts) $ ./bin/yarn global list
yarn global v1.3.2
info "[email protected]" has binaries:
   - bsb
   - bsc
   - bsrefmt
info "[email protected]" has binaries:
   - exp
info "[email protected]" has binaries:
   - ocamlmerlin
   - ocamlmerlin-reason
   - ocamlrun
   - ocamlc
   - ocamlc.opt
   - ocamlopt
   - ocamlopt.opt
   - ocaml
   - rtop
   - utop
   - refmt
   - refmttype
   - reopt
   - rebuild
   - reactjs_jsx_ppx
   - reactjs_jsx_ppx_2
   - menhir
   - ocamlfind
   - reason-cli-esy-sandbox
✨  Done in 0.65s.
[20:34:42] bestander:~/work/yarn (no-global-scripts) $ yarn global list
yarn global v1.2.0
warning "[email protected]" has unmet peer dependency "react@^0.14.0 || ^15.0.0-0 || ^16.0.0-0".
info "[email protected]" has binaries:
   - bsb
   - bsc
   - bsrefmt
info "[email protected]" has binaries:
   - exp
info "[email protected]" has binaries:
   - ocamlmerlin
   - ocamlmerlin-reason
   - ocamlrun
   - ocamlc
   - ocamlc.opt
   - ocamlopt
   - ocamlopt.opt
   - ocaml
   - rtop
   - utop
   - refmt
   - refmttype
   - reopt
   - rebuild
   - reactjs_jsx_ppx
   - reactjs_jsx_ppx_2
   - menhir
   - ocamlfind
   - reason-cli-esy-sandbox
✨  Done in 2.27s.

@bestander bestander requested review from BYK and arcanis January 3, 2018 04:08
@buildsize
Copy link
Copy Markdown

buildsize Bot commented Jan 3, 2018

This change will increase the build size from 10.4 MB to 10.4 MB, an increase of 855 bytes (0%)

File name Previous Size New Size Change
yarn-[version].noarch.rpm 900.37 KB 900.4 KB 26 bytes (0%)
yarn-[version].js 3.92 MB 3.92 MB 645 bytes (0%)
yarn-legacy-[version].js 4.06 MB 4.06 MB 744 bytes (0%)
yarn-v[version].tar.gz 906.1 KB 905.51 KB -602 bytes (0%)
yarn_[version]all.deb 669.31 KB 669.36 KB 42 bytes (0%)

@arcanis
Copy link
Copy Markdown
Member

arcanis commented Jan 15, 2018

Do you remember why a full install was being run?

@arcanis arcanis merged commit e0dfd42 into yarnpkg:master Jan 15, 2018
@bestander
Copy link
Copy Markdown
Member Author

I think we needed a list of deps and the easiest way to get it was via install command.
This feature was added in one of the large commits when we were catching up on npm compatibility.
Probably a cut corner.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

yarn global list tries to install

2 participants