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

Recent yarn plugin changes add a significant amount to shell startup time #10396

Closed
bjulian5 opened this issue Nov 7, 2021 · 1 comment
Closed
Labels
Bug Something isn't working Resolution: duplicate This issue or pull request already exists

Comments

@bjulian5
Copy link

bjulian5 commented Nov 7, 2021

Describe the bug

Shell start up time has significantly increased due to a recent change to the Yarn plugin. I ran a git bisect and narrowed down the culprit to this commit f0bbef1 .

Steps to reproduce

With yarn enabled

$for i in $(seq 1 10); do /usr/bin/time zsh -i -c exit; done
        0.36 real         0.22 user         0.10 sys
        0.29 real         0.19 user         0.08 sys
        0.29 real         0.19 user         0.08 sys
        0.32 real         0.21 user         0.09 sys
        0.29 real         0.19 user         0.08 sys
        0.30 real         0.19 user         0.08 sys
        0.30 real         0.19 user         0.08 sys
        0.29 real         0.19 user         0.08 sys
        0.30 real         0.19 user         0.08 sys
        0.29 real         0.19 user         0.08 sys

With Yarn disabled

$ for i in $(seq 1 10); do /usr/bin/time zsh -i -c exit; done
        0.39 real         0.22 user         0.14 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys
        0.12 real         0.07 user         0.04 sys

Expected behavior

The startup time for the yarn plugin should not take this long to load. I suspect the culprit is the command yarn global bin which was introduced the commit I outlined earlier

$for i in $(seq 1 10); do /usr/bin/time yarn global bin; done
/usr/local/bin
        0.37 real         0.12 user         0.08 sys
/usr/local/bin
        0.16 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys
/usr/local/bin
        0.17 real         0.11 user         0.04 sys

Screenshots and recordings

No response

OS / Distro

macOS Montery

Zsh version

5.8

Terminal emulator

alacritty

If using WSL on Windows, which version of WSL

No response

Additional context

No response

@bjulian5 bjulian5 added the Bug Something isn't working label Nov 7, 2021
@mcornella
Copy link
Member

Duplicate of #10290.

@mcornella mcornella added the Resolution: duplicate This issue or pull request already exists label Nov 7, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working Resolution: duplicate This issue or pull request already exists
Projects
None yet
Development

No branches or pull requests

2 participants