Yarn: Slow `yarn global` commands: bug?

Created on 4 Feb 2017  Â·  6Comments  Â·  Source: yarnpkg/yarn

Do you want to request a feature or report a bug?
It's possibly a bug.

What is the current behavior?
Several yarn global commands seem to trigger all of the globally installed packages' scripts.

If the current behavior is a bug, please provide the steps to reproduce.

> # install packages with "heavy" scripts:
> yarn global add polymer-cli electron
Done in 156.01s.

> # all of these now take a long time because they execute polymer-cli's and electron's scripts:
> yarn global ls
Done in 36.34s.

> yarn global add left-pad
Done in 36.34s.

> yarn global remove left-pad
Done in 42.70s.

> yarn global upgrade
Done in 94.08s.

What is the expected behavior?
I didn't expect yarn to run every globally installed packages' scripts for those commands. yarn global ls, for instance, seems highly unrelated. There may be a reason for it, but it feels like a bug from the outside.

Please mention your node.js, yarn and operating system version.

> node --version
v7.4.0

> yarn --version # note: this has happened since at least v0.17
0.20.0

> [System.Environment]::OSVersion.Version

Major  Minor  Build  Revision
-----  -----  -----  --------
10     0      15014  0
cat-performance help wanted triaged

Most helpful comment

Still reproducible in 0.27.5.

yarn global list takes 214.57 seconds
screenshot from 2017-07-19 11-26-00

All 6 comments

Can repro in 0.27.0

Still reproducible in 0.27.5.

yarn global list takes 214.57 seconds
screenshot from 2017-07-19 11-26-00

Still reproducible in 1.2.1

I think this is a manifestation of #932, just with the global command so closing this as a duplicate of #932.

yarn global list is still in the order of ~4 times slower than npm -g ls for me. Is this expected?

Of note, yarn global list is so slow that it renders a progress bar. Is there a technical reason for this?

Yarn: time yarn global list

real    0m0.715s
user    0m0.779s
sys     0m0.126s

npm: time npm -g ls

real    0m0.195s
user    0m0.174s
sys     0m0.024s

Yes there is a bug, it runs install to verify integrity unnecessarily

On Mon, May 7, 2018 at 3:38 PM Derek Sifford notifications@github.com
wrote:

yarn global list is still in the order of ~4 times slower than npm -g ls
for me. Is this expected?

Of note, yarn global list is so slow that it renders a progress bar. Is
there a technical reason for this?

Yarn: time yarn global list

real 0m0.715s
user 0m0.779s
sys 0m0.126s

npm: time npm -g ls

real 0m0.195s
user 0m0.174s
sys 0m0.024s

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
https://github.com/yarnpkg/yarn/issues/2633#issuecomment-387228254, or mute
the thread
https://github.com/notifications/unsubscribe-auth/ACBdWHHYbYO61pRIKpbpMj8m-MBy-hpwks5twMzugaJpZM4L3SeR
.

Was this page helpful?
0 / 5 - 0 ratings