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

[Bug] performance issue with yarn node #2719

Closed
1 task
Ayc0 opened this issue Apr 9, 2021 · 4 comments
Closed
1 task

[Bug] performance issue with yarn node #2719

Ayc0 opened this issue Apr 9, 2021 · 4 comments
Labels
bug Something isn't working upholded Real issues without formal reproduction

Comments

@Ayc0
Copy link
Contributor

Ayc0 commented Apr 9, 2021

  • I'd be willing to implement a fix

Describe the bug

Since I switched to yarn berry, I noticed that we had a noticeable slowdown when running yarn exec commands:

For instance here is a comparison between yarn node and node -r for logging "red" in red with chalk:

(I have a lot of modules in my package but even with an empty package.json, we have the same issue, see reproduction section)

Yarn node node -r
Screen Shot 2021-04-09 at 9 52 49 AM Screen Shot 2021-04-09 at 9 52 45 AM

We can notice that there is a huge slowdown when running through yarn

To Reproduce

Reproduction
mkdir test
cd test
yarn init -y
yarn set version berry
time yarn node -e "console.log('red')"
time node -r ./.pnp.js -e "console.log('red')"

Screenshots

Node -r Yarn node
image image

Environment if relevant (please complete the following information):

  • OS: macOS 10.15.7
  • Node version: Both v15.14.0 and v12.16.1
  • Yarn version: both 2.4.0-git.20210210.hash-cb8c8d68 and 2.4.1

Additional context

Add any other context about the problem here.

@Ayc0 Ayc0 added the bug Something isn't working label Apr 9, 2021
@arcanis
Copy link
Member

arcanis commented Apr 9, 2021

Master already contains various improvements. Likely duplicate of #2560 (comment)

@arcanis arcanis added the waiting for feedback Will autoclose in a while unless more data are provided label Apr 9, 2021
@Ayc0
Copy link
Contributor Author

Ayc0 commented Apr 11, 2021

Thanks, I'll try the new master!

@Ayc0 Ayc0 closed this as completed Apr 11, 2021
@Ayc0
Copy link
Contributor Author

Ayc0 commented May 4, 2021

I don't think master improved the situation that much:

yarn node -e "console.log('a')" still takes more than 1s:

image

and I'm running yarn 3-rc2

image

@Ayc0 Ayc0 reopened this May 4, 2021
@paul-soporan paul-soporan added upholded Real issues without formal reproduction and removed waiting for feedback Will autoclose in a while unless more data are provided labels May 5, 2021
@merceyz
Copy link
Member

merceyz commented Jun 7, 2021

I'll close this as a duplicate of #2575 since yarn node goes through the same process as running scripts

@merceyz merceyz closed this as completed Jun 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 upholded Real issues without formal reproduction
Projects
None yet
Development

No branches or pull requests

4 participants