Prettier-vscode: Extension causes high cpu load

Created on 16 Jan 2020  路  6Comments  路  Source: prettier/prettier-vscode

  • Issue Type: Performance
  • Extension Name: prettier-vscode
  • Extension Version: 3.18.0
  • OS Version: Darwin x64 18.7.0
  • VSCode version: 1.41.1

Find more details here: https://github.com/microsoft/vscode/wiki/Explain-extension-causes-high-cpu-load

esbenp.prettier-vscode-unresponsive.cpuprofile.txt

investigation performance

Most helpful comment

As an FYI, the most common reason for these perf issues is that you open a project with lots of subprojects that each have their own version of prettier. What you can do is set the prettierPath to force the extension to use a single instance of prettier for your entire project.

Something like ./node_modules/prettier will set it to always use the module at the root of your workspace.

All 6 comments

For me it's big memory usage yet.

@spencer-shadley
For me reason was that my workspace contains many projects with own prettier instances in node_modules. Therefore when I edited files in all them this extension consumed almost all resources my PC (about 7Gb memory and almost always 100% CPU). But then I installed prettier globally, I've set Prettier Path to it and then all became work very well. Now VSCode consumes about 1Gb memory and there isn't more the high cpu load.

See #1135. I think this proposal would fix this problem for large repos.

Version: 1.45.1
Commit: 5763d909d5f12fe19f215cbfdd29a91c0fa9208a
Date: 2020-05-14T08:33:47.663Z (2 wks ago)
Electron: 7.2.4
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Darwin x64 19.5.0

esbenp.prettier-vscode-unresponsive.cpuprofile.txt

As an FYI, the most common reason for these perf issues is that you open a project with lots of subprojects that each have their own version of prettier. What you can do is set the prettierPath to force the extension to use a single instance of prettier for your entire project.

Something like ./node_modules/prettier will set it to always use the module at the root of your workspace.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

finalclass picture finalclass  路  4Comments

Tanmccuin picture Tanmccuin  路  3Comments

SkeLLLa picture SkeLLLa  路  4Comments

screendriver picture screendriver  路  4Comments

DanielHabenicht picture DanielHabenicht  路  4Comments