IntelliSense slow down with large json file
See original GitHub issueDoes this issue occur when all extensions are disabled?: Yes
- VS Code Version: 1.65.2
- OS Version: Ubuntu 20.04.4 LTS
IntelliSense slow down when I set value for compilerOptions->jsx
option in tsconfig.json
file. Without this option (after restart vscode) I get autocomplete suggestion less then 1 second, with compilerOptions->jsx
I get suggestion after 3-4 seconds. CPU i5 8 cores, available RAM more than 10GB.
When initializing js/ts language features
in progress IntelliSense work fast
Tried in 1.66.0-insider the result is the same
{
"compilerOptions": {
...
"jsx": "react",
...
},
"exclude": [...]
}
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:15 (6 by maintainers)
Top Results From Across the Web
Handle load time of big JSON for autocomplete on the server ...
Checking the issue it seems that it takes a lot of time to load the 50MB JSON for each request. Loading the data...
Read more >Editing json file in VS 2019 is laggy and slow
Trying to add variables and it appears to be trying to validate the json constantly while I'm typing leading to long lag times...
Read more >Speed up ReSharper (and Visual Studio) - JetBrains
The most common causes of performance problems could be eliminated with the ... This will improve the typing experience inside large files.
Read more >Strongly Typed JSON in TypeScript - DEV Community ā ā
The reason it's a compiler option is because it can slow down the compiler for large data. You might be better off using...
Read more >Improving VS Code Path Intellisense Performance - Medium
I've been fighting slowdowns in Intellisense plugins (like this) in VS ... you can exclude large folders to reduce the initial load. "files....
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Iāve been investigating this issue, and at least for the example large jsons provided here (by @steve-ross and the json files in @ryancwalshās
paintcolornerd
), it seems what is happening is that weāre taking too long to type check the very large array in the json file, because in those cases the kind of type checking/inference we do is quadratic on the size of the array literal. This affects intellisense because, in general, when you open or change something in your file that imports the large json, we have to type check it again, and it takes a while. So thereās a general slowdown on things like completions, updating errors/red squiggles, quickinfo, etc, that rely on having your file type checked.Iām now going to think about ways in which we could improve this.
I finally found this issue after days of this problem. Iād been disabling all of my VSC extensions trying to figure out why Intellisense got so slow for a project of mine.
I finally narrowed it down to this one line in a file:
import megaColors from '../data/colornerd.json';
The JSON is 3 MB. Having that one line makes Intellisense unusably slow for the whole project.