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

1.33 performance issues with TypeScript and JavaScript #71751

Closed
leeandher opened this issue Apr 5, 2019 · 17 comments
Closed

1.33 performance issues with TypeScript and JavaScript #71751

leeandher opened this issue Apr 5, 2019 · 17 comments
Assignees
Labels
javascript JavaScript support issues perf upstream Issue identified as 'upstream' component related (exists outside of VS Code)

Comments

@leeandher
Copy link

leeandher commented Apr 5, 2019

  • VSCode Version: 1.33
  • OS Version: Windows 10 (v1809)

Steps to Reproduce:

  1. Launch VSCode

Does this issue occur when all extensions are disabled?: Yes

After updating to the latest version of VSCode, it became pretty much unusable. I mainly work on web development, so that's all that I could speak on but things became measurably slower.

At idle it was consuming 45+% of CPU usage and ~1 GB RAM

Errors stopped dismissing/updating:
image

Suggestions/Intellisense stopped showing up (or took 3s+ to show up if at all):
image

Emmet/Tag autocomplete stopped functioning:
image

When I downgraded, it seemed to all go away, I tried reinstalling 3 times, everytime I selected the upgrade the problems came back. I also restarted VSCode and my computer multiple times. For now, I'm just staying at 1.32.3.

@mjbvz mjbvz self-assigned this Apr 5, 2019
@mjbvz
Copy link
Collaborator

mjbvz commented Apr 5, 2019

Please follow these instructions to collect performance information. Share the output of code --status

Could be microsoft/TypeScript#30663

@leeandher leeandher changed the title 1.33.3 Massive performance issues 1.33 Massive performance issues Apr 5, 2019
@leeandher
Copy link
Author

code --status output:

Version:          Code 1.33.0 (0dd516dd412d42323fc3464531b1c715d51c4c1a, 2019-04-04T15:14:28.026Z)
OS Version:       Windows_NT x64 10.0.17763
CPUs:             Intel(R) Core(TM) i7-8750H CPU @ 2.20GHz (12 x 2208)
Memory (System):  15.87GB (8.62GB free)
VM:               0%
Screen Reader:    no
Process Argv:
GPU Status:       2d_canvas:                    enabled
                  checker_imaging:              disabled_off
                  flash_3d:                     enabled
                  flash_stage3d:                enabled
                  flash_stage3d_baseline:       enabled
                  gpu_compositing:              enabled
                  multiple_raster_threads:      enabled_on
                  native_gpu_memory_buffers:    disabled_software
                  rasterization:                enabled
                  surface_synchronization:      enabled_on
                  video_decode:                 enabled
                  webgl:                        enabled
                  webgl2:                       enabled

CPU %   Mem MB     PID  Process
    1       85   14656  code main
    0      195    3560     window (Release Notes: 1.33.0 - leander.xyz - Visual Studio Code)
    0       34    5616       searchService
    0       14    7700       electron-crash-reporter
    0      110   14692       extensionHost
    0       53    5696         electron_node server.js
    0       32   13164         "C:\Users\leand\AppData\Local\Programs\Microsoft VS Code\Code.exe" "c:\Users\leand\AppData\Local\Programs\Microsoft VS Code\resources\app\extensions\json-language-features\server\dist\jsonServerMain" --node-ipc --clientProcessId=14692
    0       73   13836         electron_node eslintServer.js
    8      433   16508         electron_node tsserver.js
    0       45   11968           electron_node typingsInstaller.js typesMap.js
    0       11   15216       watcherService
    0       11   10456         console-window-host (Windows internal process)
    0       65   15688     shared-process
    0       87   17900     gpu-process
    0       88   18324     window (undefined)

Workspace Stats:
|  Window (Release Notes: 1.33.0 - leander.xyz - Visual Studio Code)
|    Folder (leander.xyz): 480 files
|      File types: js(173) json(140) map(47) png(37) html(22) svg(12) md(11)
|                  gitkeep(9) yml(5) webmanifest(4)
|      Conf files: package.json(3) settings.json(1)

@leeandher
Copy link
Author

I might be incorrectly identifying this as a performance issue, but it's definitely disabling the above features in the editor some how.

The related issue seemed to be a TypeScript, which I'm not using. I am using styled-components at ^4.1.3 though.

@mjbvz
Copy link
Collaborator

mjbvz commented Apr 5, 2019

Thanks. Yes this is in all likelihood a duplicate of microsoft/TypeScript#30663. Typescript also powers our JavaScript intellisense so this is the correct issue even though you are not writing typescript

Main fix
We have pushed a fix upstream to the @types file that triggered this issue.

TypeScript users should make sure they are pulling in the latest version of @types/styled-components (4.1.13) and that 4.1.0-4.1.12 are not in your project

If you are using JavaScript, you may to clear your automatic typings cache to clear the file that caused this from their cache. To do this, delete the typings typing cache file listed below and restart vscode:

  • Mac: ~/Library/Caches/TypeScript/3.4
  • Windows: %LOCALAPPDATA%\Microsoft\TypeScript\3.4
  • Linux: ~/.cache/typescript/3.4

Other possible workarounds:

@janosh
Copy link

janosh commented Apr 6, 2019

@mjbvz Thanks for this advice! rm -r ~/Library/Caches/TypeScript/3.4 (Mac) indeed solved the issue for me.

@mupkoo
Copy link

mupkoo commented Apr 8, 2019

Clearing the cache and upgrading the styled-components types fixes the problem, but the performance is still really bad...

PS Downgrading TypeScript gives me the best result

@Daniel-Griffiths
Copy link

I also have really bad performance after upgrading VS Code to 1.33

@grepug
Copy link

grepug commented Apr 11, 2019

downgrading typescript to 3.3.3 solved this problem

@ReaperTech
Copy link

problem solved by: npm install --save-dev [email protected] (which installed 3.3.4 into my workspace), then select the typescript version in the bottom of the vsc window and select "use workspace version 3.3.4"

@Daniel-Griffiths
Copy link

Just upgraded to the latest version of VSCode and that workspace trick worked for me @ReaperTech

Eventually it would be nice to have a real solution to this instead of downgrading though 😅

@ReaperTech
Copy link

I'm glad it worked for you @Daniel-Griffiths ! Maybe they will fix in the next release.

@ReaperTech
Copy link

problem also caused by extension "angular language service 0.1.11"

@loolooii
Copy link

loolooii commented May 9, 2019

@ReaperTech solution worked perfectly for me! Thanks!

@zjaml
Copy link

zjaml commented May 14, 2019

I have a nodejs project and a react project both suffering from this problem, although there's no typescript in any of them.
by doing only the following seemed to fix both problem. (didn't have to choose TS version.)
npm install --save-dev [email protected]

@janosh
Copy link

janosh commented May 15, 2019

If don don't want to have to do this on a per-project basis, you can also install TypeScript 3.3 globally

 yarn global add [email protected]

and then in your settings.json add the line

{
  "typescript.tsdk": "~/.config/yarn/global/node_modules/typescript/lib/"
}

@natterstefan
Copy link

Thank you @mjbvz, worked for me!

@antoinerousseau
Copy link

Globally installing the next (dev) version of TypeScript (with npm i -g typescript@next),
and adding it to my settings solved the issue for me.

To add to your settings, go to preferences > settings, type tsdk, in User tab edit settings.json as suggested, add this line (if installed via npm, otherwise see @janosh's comment) :

"typescript.tsdk": "/usr/local/lib/node_modules/typescript/lib/",

And then in a TypeScript file, in the bottom right of the editor, click on the TypeScript version (like 3.x.x) and choose "Use VSCode's version (3.5.x)"

@vscodebot vscodebot bot locked and limited conversation to collaborators May 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
javascript JavaScript support issues perf upstream Issue identified as 'upstream' component related (exists outside of VS Code)
Projects
None yet
Development

No branches or pull requests