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] CPU Usage when working with workspaces #840

Closed
1 task
joshmeads opened this issue Jan 30, 2020 · 4 comments
Closed
1 task

[Bug] CPU Usage when working with workspaces #840

joshmeads opened this issue Jan 30, 2020 · 4 comments
Labels
bug Something isn't working

Comments

@joshmeads
Copy link

  • I'd be willing to implement a fix

Describe the bug

Whenever I'm working with yarn workspaces I get very high CPU usage. Even after closing all yarn commands, VSCode, etc. I've tried multiple restarts but it keeps happening. Could this be to do with pnpify?

To Reproduce

Unsure - appears to be whenever working with workspaces. Last came up while testing an empty repo the following issue: #839

Screenshots

CPU is the number after ?

Screenshot 2020-01-29 at 4 18 29 PM

Screenshot 2020-01-29 at 5 22 04 PM

Environment if relevant (please complete the following information):

  • OS: OSX
  • Node version: 13.7.0
  • Yarn version: 2.0.0-rc.27
@joshmeads joshmeads added the bug Something isn't working label Jan 30, 2020
@sparebytes
Copy link

sparebytes commented Jan 30, 2020

I actually had a similar issue on Windows when I was playing with this back in December. On a few occasions closing VSCode wasn't enough. I remember zombie node processes that continued to run.

It seemed to happen consistently when I was editing a package.json and would hit ctrl+space to for the version number lookup like this. When I opened VSCode's process explorer I noticed a ton of CMD executions of NPM.

image

I had done some weird stuff to get prettier working so I have a feeling this is related to #822

@larixer
Copy link
Member

larixer commented Jan 30, 2020

@joshmeads @sparebytes Have you tried to regenerate sdk? E.g.:
yarn pnpify --sdk
The yarn v2 does not use in memory node_modules fs (which might be CPU bound) for TypeScript support in the latest editor SDK:

const TEMPLATE = (relPnpApiPath: PortablePath, module: string, {setupEnv = false, usePnpify = false}: TemplateOptions) => [

But if you generated SDK with older pnpify version you will have imports of @yarnpkg/pnpify inside .vscode/pnpify/typescript/lib/tsserver.js which will result in building in-memory node_modules fs and might hit CPU hard (at the moment, I'm working to reduce CPU usage for in-memory node_modules fs).

@andreialecu
Copy link
Contributor

andreialecu commented Jan 30, 2020

I've also seen this exact same problem. I can confirm that it disappeared after moving back to yarn v1.

Not sure who's fault it is, probably VSCode, but the same npm view commands were hanging

@merceyz
Copy link
Member

merceyz commented Jan 30, 2020

This was fixed in #800.
Try updating and running yarn pnpify --sdk again

@merceyz merceyz closed this as completed Jan 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants