Skip to content

Autocomplete when typing is really slow. #49260

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

Closed
damisparks opened this issue May 23, 2022 · 21 comments
Closed

Autocomplete when typing is really slow. #49260

damisparks opened this issue May 23, 2022 · 21 comments
Labels
Duplicate An existing issue was already created

Comments

@damisparks
Copy link

damisparks commented May 23, 2022

Issue Type: Performance Issue

Autocomplete when typing is really slow. I have to wait for at least 5 seconds to see the suggestions.

VS Code version: Code 1.67.2 (c3511e6c69bb39013c4a4b7b9566ec1ca73fc4d5, 2022-05-17T18:20:04.972Z)
OS version: Darwin arm64 21.5.0
Restricted Mode: No

System Info
Item Value
CPUs Apple M1 (8 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
oop_rasterization: enabled
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_renderer: enabled_on
video_decode: enabled
video_encode: enabled
webgl: enabled
webgl2: enabled
Load (avg) 4, 4, 5
Memory (System) 16.00GB (0.14GB free)
Process Argv . --crash-reporter-id 18c733b1-aae2-4bc9-b51e-cbe05d8afcd7
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
   15	   164	  1051	code main
    6	    82	  1075	   gpu-process
    0	    33	  1077	   utility-network-service
    0	   279	  1079	   window (index.vue — b2b-app)
   29	   147	  1080	   shared-process
    0	    49	  1082	     ptyHost
    0	    49	  2188	       npm run dev
    0	  1016	  2204	         node /Users/damiliner/damistack/workspace/b2b-app/node_modules/.bin/nuxt
    0	   262	  2219	           /opt/homebrew/Cellar/node@16/16.14.2/bin/node --max-old-space-size=2048 /Users/damiliner/damistack/workspace/b2b-app/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js
    0	    66	  2220	           /opt/homebrew/Cellar/node@16/16.14.2/bin/node --max-old-space-size=2048 /Users/damiliner/damistack/workspace/b2b-app/node_modules/fork-ts-checker-webpack-plugin/lib/typescript-reporter/reporter/TypeScriptReporterRpcService.js
    0	     0	  3477	       /opt/homebrew/bin/zsh -l
    0	    33	  1084	     fileWatcher
    0	    49	  4619	     fileWatcher
    0	     0	  8956	     /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command=
    0	   328	  1083	   extensionHost
    0	    33	  1088	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/formulahendry.auto-rename-tag-0.1.10/packages/server/dist/serverMain.js --node-ipc --clientProcessId=1083
    0	    49	  1115	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/bradlc.vscode-tailwindcss-0.8.4/dist/tailwindServer.js --node-ipc --clientProcessId=1083
    0	    49	  1118	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=1083
    0	   164	  6359	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js --node-ipc --clientProcessId=1083
    0	   229	  6368	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/octref.vetur-0.35.0/server/dist/vueServerMain.js --node-ipc --clientProcessId=1083
   71	   360	  1548	   window (NursingHomeController.js — api)
    0	   180	  4618	   extensionHost
    0	    98	  4629	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node --max-old-space-size=3072 /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName /var/folders/rj/s5ftcl0n6bj3cj7h7j162kgc0000gn/T/vscode-typescript501/2764f4da0711c7e1050e/tscancellation-914ec9d01a6656410e83.tmp* --globalPlugins typescript-tslint-plugin,@vsintellicode/typescript-intellicode-plugin --pluginProbeLocations /Users/damiliner/.vscode/extensions/ms-vscode.vscode-typescript-tslint-plugin-1.3.4,/Users/damiliner/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.2.21 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	   328	  4630	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node --max-old-space-size=3072 /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName /var/folders/rj/s5ftcl0n6bj3cj7h7j162kgc0000gn/T/vscode-typescript501/2764f4da0711c7e1050e/tscancellation-85538ff4b124bd5c4a73.tmp* --globalPlugins typescript-tslint-plugin,@vsintellicode/typescript-intellicode-plugin --pluginProbeLocations /Users/damiliner/.vscode/extensions/ms-vscode.vscode-typescript-tslint-plugin-1.3.4,/Users/damiliner/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.2.21 --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	    49	  4634	       /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js --globalTypingsCacheLocation /Users/damiliner/Library/Caches/typescript/4.6 --enableTelemetry --typesMapLocation /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/node_modules/typescript/lib/typesMap.json --validateDefaultNpmLocation
    0	    49	  4632	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/formulahendry.auto-rename-tag-0.1.10/packages/server/dist/serverMain.js --node-ipc --clientProcessId=4618
    0	    66	  4639	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=4618
    0	   115	  4667	     /Applications/Visual Studio Code.app/Contents/MacOS/Electron --ms-enable-electron-run-as-node /Users/damiliner/.vscode/extensions/dbaeumer.vscode-eslint-2.2.2/server/out/eslintServer.js --node-ipc --clientProcessId=4618
   25	    82	  8954	   issue-reporter
Workspace Info
|  Window (NursingHomeController.js — api)
|  Window (index.vue — b2b-app)
|    Folder (api): 84 files
|      File types: js(51) json(6) DS_Store(2) yaml(2) pem(2) env(1) example(1)
|                  backend(1) gitignore(1) md(1)
|      Conf files: settings.json(1) package.json(1)
|    Folder (b2b-app): 315 files
|      File types: vue(107) js(52) ts(31) png(19) json(10) DS_Store(8) md(4)
|                  yml(3) html(3) yaml(3)
|      Conf files: github-actions(1) settings.json(1) package.json(1)
|                  tsconfig.json(1);
Extensions (29)
Extension Author (truncated) Version
better-comments aar 3.0.0
project-manager ale 12.6.0
copy-relative-path ale 0.0.2
vscode-tailwindcss bra 0.8.4
npm-intellisense chr 1.4.1
path-intellisense chr 2.8.0
vscode-eslint dba 2.2.2
gitlens eam 12.0.6
vscode-npm-script eg2 0.3.25
prettier-vscode esb 9.5.0
auto-close-tag for 0.5.14
auto-rename-tag for 0.1.10
vscode-pull-request-github Git 0.42.0
vscode-peacock joh 4.0.1
vscode-docker ms- 1.22.0
remote-containers ms- 0.234.0
vscode-typescript-tslint-plugin ms- 1.3.4
vetur oct 0.35.0
vue-vscode-extensionpack sdr 0.2.0
vue-vscode-snippets sdr 3.1.1
vscode-fileutils sle 3.5.0
vscode-status-bar-format-toggle tom 3.0.0
vscodeintellicode Vis 1.2.21
vscode-icons vsc 11.12.0
quokka-vscode Wal 1.0.476
vscode-import-cost wix 3.3.0
vscode-jumpy wma 0.3.1
JavaScriptSnippets xab 1.8.0
markdown-all-in-one yzh 3.4.3

(1 theme extensions excluded)

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyl392:30443607
pythontb:30283811
pythonvspyt551cf:30345471
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscorecescf:30445987
pythondataviewer:30285071
vscod805:30301674
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593:30376534
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30492333
vsclangdc:30486549

See the image below.
image

@jrieken
Copy link
Member

jrieken commented May 23, 2022

It looks like the issue is caused by one of your installed extensions. All extensions execute together on a single nodejs process, so in order to narrow down the possible problematic extension, please try the following:

  • run F1 > Help: Start Extension Bisect
  • (this will restart VS Code with half of your extensions disabled)
  • try to do the steps which reproduce the problem
  • if the problem reproduces, click "This is bad" (this narrows down the problematic extension to the half which was enabled)
  • if the problem does not reproduce, click "Good now" (this narrows down the problematic extension to the half which was disabled)
  • these steps will repeat until the problematic extension is found
initial step final
image image image

@jrieken jrieken added the Needs More Info The issue still hasn't been fully clarified label May 23, 2022
@damisparks
Copy link
Author

damisparks commented May 25, 2022

@jrieken
Thank you for providing the steps for troubleshooting this.

Here is what I got after. 👇🏾
image

Quick update.

  • I noticed the slowness only occurs on this specific project I am working on.
  • However, I tried creating a jsconfig.json file for the project according to these docs What is jsconfig.json? The slowness stops and started again this morning.
  • Here is the content of the jsconfig.json 👇🏾
{
  "compilerOptions": {
    "module": "ESNext",
    "moduleResolution": "Node",
    "target": "ES2020",
    "jsx": "preserve",
    "strictFunctionTypes": true
  },
  "exclude": ["node_modules", "**/node_modules/*"]
}

I am still having the same issue 🤦🏾‍♂️

I tried something else.

  • I deleted the node_modules and install it again
  • it started working normally again. It is quite strange.

@jrieken
Copy link
Member

jrieken commented May 25, 2022

So, the problem only occurs with specific projects and those are all JavaScript/Typescript? Is that right? Is auto-complete in other files, like CSS or HTML, acceptable fast?

@damisparks
Copy link
Author

So, the problem only occurs with specific projects, and those are all JavaScript/Typescript? Is that right? Is auto-complete in other files, like CSS or HTML, acceptable fast?

To answer your question:

  • Yes, the problem only occurs with this specific JavaScript project.
  • Other projects are working absolutely fine

@jrieken jrieken assigned mjbvz and unassigned jrieken May 25, 2022
@jrieken jrieken removed the Needs More Info The issue still hasn't been fully clarified label May 25, 2022
@mjbvz
Copy link
Contributor

mjbvz commented May 25, 2022

Does this reproduce in the latest VS Code insiders build with all extensions disabled?

If it does, please share a minimal project that demonstrates the issue

@mjbvz mjbvz added the Needs More Info The issue still hasn't been fully clarified label May 25, 2022
@damisparks
Copy link
Author

@mjbvz
Thank you for your suggestion.

  • The issue reproduces with the last VS Code insiders build with all extensions disabled.
  • I created a simple node project with only express installed via npm. Everything works fine with or without the extensions disabled.

At this time, I am lost and still investigating the issue.

Nevertheless, I noticed one thing though.
For this specific project that I am having issue with, I have to reload VS code multiple times for the autocomplete to work normally.
To give more context,

  • I reload and type to see what happens, if the autocomplete works as fast it should be, I continue working else I reload again.

below is the package.json file content :

{
  "name": "api",
  "version": "1.0.0",
  "description": "API v1",
  "main": "server.js",
  "scripts": {
    "test": "mocha -R spec './apis/test/**/*.js' --exit",
    "lint": "eslint ./apis/*.js",
    "dev:nodemon": "nodemon apis/server.js",
    "dev:app": "DEBUG=app,app:* nodemon NODE_ENV=development ./apis/server.js",
    "dev:debug": "nodemon --inspect ./apis/server.js",
  },
  "author": "Dami Sparks Omifare <[email protected]>",
  "license": "",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/damisparks/fitplus.git"
  },
  "dependencies": {
    "@google-cloud/storage": "5.8.5",
    "@sendgrid/mail": "7.4.2",
    "bcryptjs": "2.4.3",
    "body-parser": "1.19.0",
    "chalk": "4.1.0",
    "cookie-parser": "1.4.5",
    "cors": "2.8.5",
    "debug": "4.3.1",
    "dotenv": "8.2.0",
    "express": "4.17.1",
    "helmet": "4.4.1",
    "jsonwebtoken": "8.5.1",
    "mongoose": "5.11.15",
    "mongoose-unique-validator": "2.0.3",
    "morgan": "1.10.0",
    "multer": "1.4.2",
    "slugify": "1.6.5",
    "socket.io": "4.5.1",
    "uuid": "8.3.2"
  },
  "nodemonConfig": {
    "restartable": "rs",
    "ignore": [
      ".git",
      "node_modules/**/node_modules"
    ],
    "env": {
      "NODE_ENV": "development"
    }
  },
  "devDependencies": {
    "eslint": "7.19.0",
    "eslint-config-airbnb-base": "14.2.1",
    "eslint-plugin-import": "2.22.1",
    "nodemon": "2.0.7"
  }
}

@mjbvz mjbvz transferred this issue from microsoft/vscode May 26, 2022
@mjbvz mjbvz removed their assignment May 26, 2022
@mjbvz mjbvz removed the Needs More Info The issue still hasn't been fully clarified label May 26, 2022
@mjbvz
Copy link
Contributor

mjbvz commented May 26, 2022

Thanks. Based on the package.json's use of mongoose I suspect this is a duplicate of Automattic/mongoose#10349

Moving to TS to confirm this though

@andrewbranch
Copy link
Member

Yes, and we have #48517 open on our end.

@andrewbranch andrewbranch added the Duplicate An existing issue was already created label May 27, 2022
@JustFly1984
Copy link

JustFly1984 commented May 27, 2022

this could be related to incomplete tsconfig setup, or eslintrc. You need to add node_modules, and build artifacts into exclude sections of tsconfig, and eslintrc files. This way it will stop looking there, hence reduce the load on CPU.

@damisparks
Copy link
Author

this could be related to incomplete tsconfig setup, or eslintrc. You need to add node_modules, and build artifacts into exclude sections of tsconfig, and eslintrc files. This way it will stop looking there, hence reduce the load on CPU.

@JustFly1984
I do not have any tsconfig.
Below is my .eslintrc.js config

module.exports = {
  env: {
    commonjs: true,
    es2021: true,
    node: true,
  },
  extends: [
    'airbnb-base',
  ],
  parserOptions: {
    ecmaVersion: 12,
  },
  rules: {
    'no-underscore-dangle': 0,
    'no-unused-vars': 'error',
  },
};

@typescript-bot
Copy link
Collaborator

This issue has been marked as a 'Duplicate' and has seen no recent activity. It has been automatically closed for house-keeping purposes.

@damisparks
Copy link
Author

How is this closed when the issue is not solved.

At least a workaround would be nice.

@andrewbranch
Copy link
Member

?? It’s closed because it’s a duplicate of #48517

@damisparks
Copy link
Author

?? It’s closed because it’s a duplicate of #48517

Thank you @andrewbranch
I will keep track of the other issue.
Do you have any suggestions for now?
If not I guess I have to keep reloading my vscode, which sucks.

@andrewbranch
Copy link
Member

Try not using mongoose 😞

@damisparks
Copy link
Author

Try not using mongoose 😞

Any alternatives to recommend?

@andrewbranch
Copy link
Member

Maybe mongodb directly? I don’t know, it’s been years since I used mongodb for a project. You could ask in Automattic/mongoose#10349

@damisparks
Copy link
Author

damisparks commented Jun 3, 2022

Maybe mongodb directly? I don’t know, it’s been years since I used mongodb for a project. You could ask in Automattic/mongoose#10349

Thank you @andrewbranch for the suggestion. I will look into that. I appreciate.
To conclude, I downgraded my mongoose version to "mongoose": "5.10.19", and everything is working fine. Hallelujah 🕺🏾

@andrewbranch
Copy link
Member

@damisparks In that thread the maintainers said they think it’s fixed in mongoose v6. Were you able to try that, or is it too big of an upgrade?

@damisparks
Copy link
Author

@andrewbranch I have not tried the update yet. However, I will check it out, and thank you for letting me know.

@andrewbranch
Copy link
Member

If you go back to that mongoose issue, you can see I’ve done some more investigation in the meantime... and for me v6 is slower 😅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Duplicate An existing issue was already created
Projects
None yet
Development

No branches or pull requests

6 participants