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

Intellisense Extremely Slow #53541

Closed
bladnman opened this issue Jul 4, 2018 · 17 comments
Closed

Intellisense Extremely Slow #53541

bladnman opened this issue Jul 4, 2018 · 17 comments
Assignees
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues

Comments

@bladnman
Copy link

bladnman commented Jul 4, 2018

  • VSCode Version: 1.25.0-insider
  • OS Version: Windows 10 1709

Steps to Reproduce:

  1. Type Character
  2. CTRL-SPACE to auto-complete
  3. Go Eat lunch
  4. Continue work

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

I have seen many other issues here opened about this problem but they all seem to get closed in some way or another. I cannot be the only one experiencing the broken-ness of Intellisense.

I am working in a JavaScript project that is not small on a very strong machine. When I first launch VSC if I let the editor rest a bit (perhaps index reading, not sure) then Intellisense works very well. After a bit of work in the editor (sometimes immediately but often a few minutes of bliss) the dreaded loading... indicator is all I get. I can wait from anywhere between 30s and 90s and the window does eventually appear. It's worth saying this is not progressive -- meaning once it goes south it never takes less than 30s.

During this time there are not other large processes running to spike the CPU. This seems to really be within VSC itself.

It is also worth noting that there are times when if I let it complete it's loading cycle it starts working at normal speed again for a bit. This usually does not last long (2m) but it does happen.

I am willing to get the "intelli" part disabled if at least macros and auto-complete for local values worked. Any way to limit what it was trying to look through to present the feature.

@vscodebot vscodebot bot assigned mjbvz Jul 4, 2018
@vscodebot vscodebot bot added the javascript JavaScript support issues label Jul 4, 2018
@jacobweber
Copy link

jacobweber commented Jul 6, 2018

Seeing this after updating from 1.24.1 to 1.25.0 on Mac. Downgrading to 1.24.1 fixes it.

@TungJerry
Copy link

I have same issue after updating to 1.25.0 on Mac.

@thaiihuy
Copy link

I have same issue after updating to 1.25.0 on Window. Try to downgrade VSCode

@mjbvz
Copy link
Collaborator

mjbvz commented Jul 19, 2018

Using VS Code insiders, please try collecting the TS Server log:

  1. Set "typescript.tsserver.log": "verbose",
  2. Restart VS Code and reproduce the problem
  3. In VS Code, run the TypeScript: Open TS Server log command
  4. This should open a folder with a tsserver.log file in it

Look through that log file for errors or stack traces. If you can share the log, I can also take a look to see if anything stands out

⚠️Warning: The TypeScript log may include information from your workspace, including file paths and source code. If you have any concerns about posting this publicly on Github, just let me know and we can arrange something else. On our side, we only use these logs to investigate issues like this

@mjbvz mjbvz added the info-needed Issue requires more information from poster label Jul 19, 2018
@espenbjorkeng
Copy link

Same behaviour here.

Intellisense is fast immediately after restart, but after a while (30 minutes or so, maybe less) I always have to press CTRL + SPACE and wait a second or two before snippets and other suggestions appear.

Windows 10
Version: 1.25.1

@mitchelldemler
Copy link

mitchelldemler commented Jul 27, 2018

Same here on Windows 10, v1.25.1. Co-workers experiencing the same thing.

Possibly the same issue, but it also hangs when we press F12 (Go to definition) in our Typescript project. Takes anywhere up to 30s to find.

I'm going to try downgrading to 1.24.1 until this is resolved as 1.25.1 is unusable at the moment.

(For anyone else struggling to find the 1.24.1 Windows x64 download).

From Logs:

Info 856  [15:50:38.104] For info: c:/repos/xxxxxs/WebUi/src/areas/Conjunctionals/components/xxxxxOfficePicker.tsx :: Config file name: c:/repos/xxxxxs/WebUi/tsconfig.json
Info 857  [15:50:38.105] Project 'c:/repos/xxxxxs/WebUi/tsconfig.json' (Configured) 0
Info 857  [15:50:38.105] 	Files (661)
	c:/repos/xxxxxs/WebUi/node_modules/typescript/lib/lib.es6.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/redux/index.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/DOMUtils.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/createBrowserHistory.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/createHashHistory.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/createMemoryHistory.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/LocationUtils.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/PathUtils.d.ts
	c:/repos/xxxxxs/WebUi/node_modules/@types/history/index.d.ts

600 files listed below...

Not sure if relevant, but every time I open a file in the editor, the logs say that ~661 files are affected. I'm not sure if this is normal?

@luchsamapparat
Copy link

luchsamapparat commented Aug 10, 2018

I can confirm this, however in my project it's 1171 files. And as far as I can see it's not just once per file … I opened my project workspace, opened one file and then CTRL+clicked on a class to navigate to another file. Here's the complete log file:
tsserver.log

The project I used is this one: https://github.com/luchsamapparat/cfha-client

Another thing I've noticed: I have these performance issues in all my Angular projects, however another Node.js project is as fast as it can get. Also: All my colleagues experience the same performance issues (at least the Windows users). And disabling all extensions didn't help.

@joostme
Copy link

joostme commented Aug 13, 2018

We are experiencing extremely slow intellisense in our projects (Angular projects).

Steps to reproduce:

  1. Open a .ts file
  2. CTRL-Click on any reference inside the same project
  3. Wait for 20-30 seconds for VSCode to open the file the reference is located in

This slows down our development immensely.

Following lines always appear in the tsserver.log when doing a CTRL-Click on a reference:

Info 0    [12:25:35.438] Starting TS Server
Info 1    [12:25:35.439] Version: 3.1.0-dev
Info 2    [12:25:35.440] Arguments: C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe C:\Users\Joost\AppData\Roaming\npm\node_modules\typescript\lib\tsserver.js --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\Joost\AppData\Local\Temp\vscode-typescript\tscancellation-db7b1b580ffa571e6fc0.tmp* --logVerbosity verbose --logFile C:\Users\Joost\AppData\Roaming\Code - Insiders\logs\20180813T122004\vscode.typescript-language-features_1\tsserver-log-dWDwm2\tsserver.log --locale de --noGetErrOnBackgroundUpdate
Info 3    [12:25:35.440] Platform: win32 NodeVersion: 8 CaseSensitive: false
Info 4    [12:25:35.447] Binding...

...

Info 14   [12:25:35.557] request:
    {"seq":2,"type":"request","command":"open","arguments":{"file":"c:/Users/Joost/git/project/project-project/src/app/shared/entity/entity.selectors.ts","fileContent":"<FILE_CONTENT>","scriptKindName":"TS","projectRootPath":"c:\\Users\\Joost\\git\\project\\project-client"}}

...
>>> Typescript looks for the tsconfig.json in parent directories
...

Info 25   [12:25:35.564] For info: c:/Users/Joost/git/project/project-client/src/app/shared/entity/entity.selectors.ts :: Config file name: c:/Users/Joost/git/project/project-client/tsconfig.json
Info 26   [12:25:36.168] Opened configuration file c:/Users/Joost/git/project/project-client/tsconfig.json
Info 27   [12:25:36.175] FileWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/tsconfig.json 2000 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Config file for the program
Info 28   [12:25:36.176] DirectoryWatcher:: Added:: WatchInfo: c:/users/joost/git/project/project-client 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Wild card directory
Info 29   [12:25:36.176] c for path c:/users/joost/git/project/project-client not found in cache...
Info 30   [12:25:36.178] Starting C:\Program Files\Microsoft VS Code Insiders\Code - Insiders.exe with args:
    ["C:/Users/Joost/AppData/Roaming/npm/node_modules/typescript/lib/watchGuard.js","c:/users/joost/git/project/project-client"]
Info 31   [12:25:36.454] WatchGuard for path c:/users/joost/git/project/project-client returned: OK
Info 32   [12:25:36.454] Elapsed:: 278ms DirectoryWatcher:: Added:: WatchInfo: c:/users/joost/git/project/project-client 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Wild card directory

...
>>> Typescript traverses all project .ts files e.g.
Info 40   [12:25:36.462] FileWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/src/app/app.component.spec.ts 500 Project:  WatchType: Closed Script info
...

Info 646  [12:25:37.174] Starting updateGraphWorker: Project: c:/Users/Joost/git/project/project-client/tsconfig.json
Info 647  [12:25:37.446] FileWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/node_modules/protractor/built/index.d.ts 500 Project:  WatchType: Closed Script info
Info 648  [12:25:37.454] DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/node_modules 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Directory of Failed lookup locations in module resolution
Info 649  [12:25:37.454] watchDirectory for c:/Users/Joost/git/project/project-client/node_modules uses cached drive information.
Info 650  [12:25:37.454] Elapsed:: 0ms DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/node_modules 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Directory of Failed lookup locations in module resolution

... 
>>> Typescript traverses all node_modules d.ts files e.g.:
Info 651  [12:25:37.494] FileWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/node_modules/protractor/built/browser.d.ts 500 Project:  WatchType: Closed Script info
...

Info 2227 [12:25:48.146] DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/e2e 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Directory of Failed lookup locations in module resolution
Info 2228 [12:25:48.146] watchDirectory for c:/Users/Joost/git/project/project-client/e2e uses cached drive information.
Info 2229 [12:25:48.146] Elapsed:: 0ms DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/e2e 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Directory of Failed lookup locations in module resolution
Info 2230 [12:25:48.660] DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/node_modules 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Directory of Failed lookup locations in module resolution
Info 2231 [12:25:48.660] watchDirectory for c:/Users/Joost/git/project/node_modules uses cached drive information.
Info 2232 [12:25:48.661] Elapsed:: 1ms DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/node_modules 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Directory of Failed lookup locations in module resolution
Info 2233 [12:25:48.930] DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/node_modules/@types 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Type root directory
Info 2234 [12:25:48.930] watchDirectory for c:/Users/Joost/git/project/project-client/node_modules/@types uses cached drive information.
Info 2235 [12:25:48.931] Elapsed:: 1ms DirectoryWatcher:: Added:: WatchInfo: c:/Users/Joost/git/project/project-client/node_modules/@types 1 Project: c:/Users/Joost/git/project/project-client/tsconfig.json WatchType: Type root directory
Info 2236 [12:25:48.931] Finishing updateGraphWorker: Project: c:/Users/Joost/git/project/project-client/tsconfig.json Version: 1 structureChanged: true Elapsed: 11757ms
...

What I find irritating is that Typescript scans node_modules folder even though the reference I clicked is inside the project itself. So it should have stopped at line 646.

Also notice the WatchType: Directory of Failed lookup locations in module resolution errors on line 648 and following.

The whole process took over 10 seconds and that is after I freshly restarted VSCode.

I am running on VSCode - Insiders build as well as typescript@next.

@luchsamapparat
Copy link

Is there anything else I can provide to investigate this issue? I see a lot of other Performance issues being closed due to inactivity/missing feedback from the original poster. However, I have this problem since at least the last 2 major releases and it is the same for a couple of colleagues of mine.

@mjbvz
Copy link
Collaborator

mjbvz commented Aug 22, 2018

@luchsamapparat What TS version are you using? That log you uploaded is using TypeScript 2.7.2. Do you see this when using TypeScript 3.0.1?

@luchsamapparat
Copy link

luchsamapparat commented Aug 22, 2018

@mjbvz Here's an updated tsserver.log für TS 3.0.1. It does not feel significantly faster. It still takes way to long to even CTRL+Click on symbols defined in the same file.

tsserver.log

Thanks for looking into this

@mjbvz
Copy link
Collaborator

mjbvz commented Aug 22, 2018

@joostme and @luchsamapparat can you both please open new issues against typescript with those server logs: https://github.com/Microsoft/TypeScript/issues/new?template=Bug_report.md

From the logs, I see that initial project load takes ~20 second and don't think this caused by VS Code

@luchsamapparat
Copy link

@mjbvz I am now more confused than ever. It appears, that there are several causes for the performance issues. In my initial post, I said that the problem also persists when deactivating all extensions. Now, with the latest VS Code as well as TypeScript version, the initial load time is indeed still slow. However, after that all further code navigation is severely slowed down by the Angular Language Service. When deactivating that extension, it's as fast as it has been months ago.

I'll open a bug report against typescript regarding the initial load time, and one against the Angular Language Service regarding the other performance issues.

Thanks for your assistance 👍

@mjbvz
Copy link
Collaborator

mjbvz commented Sep 5, 2018

@bladnman Does what @luchsamapparat describe also cover your original issue?

@vscodebot vscodebot bot closed this as completed Sep 13, 2018
@vscodebot
Copy link

vscodebot bot commented Sep 13, 2018

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

@violettomsk
Copy link

disabling heavy extensions solves problem for me.

@nasreddineskandrani
Copy link

nasreddineskandrani commented Sep 27, 2018

@luchsamapparat

Now, with the latest VS Code as well as TypeScript version, the initial load time is indeed still slow.
However, after that all further code navigation is severely slowed down by the Angular Language Service.
When deactivating that extension, it's as fast as it has been months ago.`

In an angular project context, for me too deactivation of the extension Angular Language Service resolve the issue.

I'll open a bug report against typescript regarding the initial load time, and one against the Angular
Language Service regarding the other performance issues.

=> Did you do it? i don't see any issue linked to this github issue. Can you reference it please? i may try to fix the extension my self.

edit: i found this issue we can use it i guess angular/vscode-ng-language-service#44

@vscodebot vscodebot bot locked and limited conversation to collaborators Oct 28, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
info-needed Issue requires more information from poster javascript JavaScript support issues
Projects
None yet
Development

No branches or pull requests