-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
[RED-16] Slow intellisense in VSCode #3214
Copy link
Copy link
Labels
PerformanceIssues regarding performanceIssues regarding performanceRTK-QueryIssues related to Redux-Toolkit-QueryIssues related to Redux-Toolkit-QueryTypeScriptIssues related to TypeScript.Issues related to TypeScript.
Milestone
Metadata
Metadata
Assignees
Labels
PerformanceIssues regarding performanceIssues regarding performanceRTK-QueryIssues related to Redux-Toolkit-QueryIssues related to Redux-Toolkit-QueryTypeScriptIssues related to TypeScript.Issues related to TypeScript.
Hey 👋
I'm trying to figure out what slows our VSCode intellisense (TS-backed code auto-complete) down and may have found the main cause.
Not 100% sure it's RTK Query (
createApi) or not, but figured it's a decent-enough thing I found that I may as well share it.Where I work at we have a pretty hefty React/RTK app (not OSS 😞), we've been dealing with slow (not unbearable, but annoying) response rate from VSCode intellisense (feels like >1s until the suggestions list shows up, but looking at the TS Server logs it's probably ~800ms).
I tried a few things, eventually landed on this:
If I any-fy the call to
createApi, the TS Server logs report thatcompletionInfo(which is in charge of computing the list of suggested items that show up in VSCode's autocomplete) drops from 840ms to 122ms.Here's a video before the change (note how slow it takes from the time I hit
.to when I see the suggestions:CleanShot.2023-02-25.at.21.15.29.mp4
Here it is when I make the following change:
To:
CleanShot.2023-02-25.at.21.14.31.mp4
RED-16