TypeScript: Semantic highlighting (`encodedSemanticClassifications-full`) extremely slow

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

  • VS Code Version: 1.57.0-1623259737
  • OS Version: Debian GNU/Linux 11 (bullseye)

In 1.57.0-1623259737 version IntelliSense is terribly slow. I’ve no Idea, what more details should I provide. I’ve tested it on TypeScript/React project (also with all extensions disabled - with the same result - loading hint takes more than 10 seconds).

After downgrade to 1.56.2-1620838498 everything works great.

About this issue

  • Original URL
  • State: closed
  • Created 3 years ago
  • Reactions: 24
  • Comments: 65 (18 by maintainers)

Most upvoted comments

Why is this closed? It’s not fixed even in latest version. I still see significant performance regression.

Update: this may be related to TypeScript 4.3? After updating our codebase to TS43 VSCode’s Intellisense has slowed down to a crawl even when using 1.56.2.

I have this same issue on 1.57 and 1.58 (Insider) VSC, noticed Intellisense in VS code slowing down significantly. Downgrading to Typescript 4.2 seems to speed things up by a factor of 10.

Server log attached.

tsserver.log

Hey team,

I’m also experiencing this in the latest one. I’m not sure why it’s closed? Doesn’t happen on my mac though. It only happens on my PC (windows).

When i press save, it takes 4-5s for typescript to update the errors in my vscode

I’ve encountered this as well recently, latence builds (>3s) up as soon as I start to use react-hook-form in a basic react project, which as of ^7.17.4 has no dependencies (eg. no ajv anymore).

Setting "editor.semanticHighlighting.enabled": false does not fix the issue but does cut around ~1s of latence (confirmed by the logs).

I can’t find any other cause of latence in the two tsserver logs, so it seems to come from somewhere else?

Can confirm that downgrading to typescript@~4.2 does greatly improve the latence issue.

Before (no lag):

Screen Recording 2021-10-15 at 10 41 31

  • After with "editor.semanticHighlighting.enabled": false (lag):

Screen Recording 2021-10-15 at 10 41 47

  • <syntax> Log extract
Perf 1964 [10:42:45.165] 529::updateOpen: elapsed time (in milliseconds) 0.2350
Info 1965 [10:42:45.165] response:
    {"seq":0,"type":"response","command":"updateOpen","request_seq":529,"success":true,"body":true}
Info 1966 [10:42:45.166] request:
    {"seq":530,"type":"request","command":"getOutliningSpans","arguments":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx"}}
Info 1967 [10:42:45.166] Starting updateGraphWorker: Project: /dev/null/inferredProject1*
Info 1968 [10:42:45.168] Finishing updateGraphWorker: Project: /dev/null/inferredProject1* Version: 122 structureChanged: false structureIsReused:: Completely Elapsed: 2.244997978210449ms
Info 1969 [10:42:45.168] Different program with same set of files
Perf 1970 [10:42:45.169] 530::getOutliningSpans: elapsed time (in milliseconds) 3.4489
Info 1971 [10:42:45.169] response:
    {"seq":0,"type":"response","command":"getOutliningSpans","request_seq":530,"success":true,"performanceData":{"updateGraphDurationMs":2.244997978210449},"body":[{"textSpan":{"start":{"line":1,"offset":1},"end":{"line":2,"offset":78}},"hintSpan":{"start":{"line":1,"offset":1},"end":{"line":2,"offset":78}},"bannerText":"...","autoCollapse":false,"kind":"imports"},{"textSpan":{"start":{"line":6,"offset":52},"end":{"line":6,"offset":81}},"hintSpan":{"start":{"line":6,"offset":52},"end":{"line":6,"offset":81}},"bannerText":"...","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":6,"offset":85},"end":{"line":21,"offset":2}},"hintSpan":{"start":{"line":6,"offset":51},"end":{"line":21,"offset":2}},"bannerText":"...","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":7,"offset":8},"end":{"line":10,"offset":4}},"hintSpan":{"start":{"line":7,"offset":9},"end":{"line":10,"offset":4}},"bannerText":"...","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":8,"offset":15},"end":{"line":8,"offset":26}},"hintSpan":{"start":{"line":8,"offset":16},"end":{"line":8,"offset":26}},"bannerText":"...","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":12,"offset":5},"end":{"line":19,"offset":8}},"hintSpan":{"start":{"line":12,"offset":5},"end":{"line":19,"offset":8}},"bannerText":"<>...</>","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":14,"offset":9},"end":{"line":17,"offset":69}},"hintSpan":{"start":{"line":14,"offset":9},"end":{"line":17,"offset":69}},"bannerText":"...","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":17,"offset":18},"end":{"line":17,"offset":27}},"hintSpan":{"start":{"line":17,"offset":18},"end":{"line":17,"offset":27}},"bannerText":"...","autoCollapse":false,"kind":"code"},{"textSpan":{"start":{"line":17,"offset":39},"end":{"line":17,"offset":65}},"hintSpan":{"start":{"line":17,"offset":39},"end":{"line":17,"offset":65}},"bannerText":"...","autoCollapse":false,"kind":"code"}]}
Info 1972 [10:42:45.314] request:
    {"seq":531,"type":"request","command":"navtree","arguments":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx"}}
Perf 1973 [10:42:45.315] 531::navtree: elapsed time (in milliseconds) 0.7920
Info 1974 [10:42:45.315] response:
    {"seq":0,"type":"response","command":"navtree","request_seq":531,"success":true,"body":{"text":"\"Test\"","kind":"module","kindModifiers":"","spans":[{"start":{"line":1,"offset":1},"end":{"line":21,"offset":4}}],"childItems":[{"text":"Controller","kind":"alias","kindModifiers":"","spans":[{"start":{"line":2,"offset":10},"end":{"line":2,"offset":20}}],"nameSpan":{"start":{"line":2,"offset":10},"end":{"line":2,"offset":20}}},{"text":"ControllerProps","kind":"alias","kindModifiers":"","spans":[{"start":{"line":2,"offset":22},"end":{"line":2,"offset":37}}],"nameSpan":{"start":{"line":2,"offset":22},"end":{"line":2,"offset":37}}},{"text":"FunctionComponent","kind":"alias","kindModifiers":"","spans":[{"start":{"line":1,"offset":16},"end":{"line":1,"offset":33}}],"nameSpan":{"start":{"line":1,"offset":16},"end":{"line":1,"offset":33}}},{"text":"HTMLProps","kind":"alias","kindModifiers":"","spans":[{"start":{"line":1,"offset":35},"end":{"line":1,"offset":44}}],"nameSpan":{"start":{"line":1,"offset":35},"end":{"line":1,"offset":44}}},{"text":"React","kind":"alias","kindModifiers":"","spans":[{"start":{"line":1,"offset":8},"end":{"line":1,"offset":13}}],"nameSpan":{"start":{"line":1,"offset":8},"end":{"line":1,"offset":13}}},{"text":"Test","kind":"const","kindModifiers":"export","spans":[{"start":{"line":6,"offset":14},"end":{"line":21,"offset":2}}],"nameSpan":{"start":{"line":6,"offset":14},"end":{"line":6,"offset":18}},"childItems":[{"text":"<function>","kind":"function","kindModifiers":"","spans":[{"start":{"line":17,"offset":17},"end":{"line":17,"offset":68}}]},{"text":"control","kind":"const","kindModifiers":"","spans":[{"start":{"line":9,"offset":5},"end":{"line":9,"offset":12}}],"nameSpan":{"start":{"line":9,"offset":5},"end":{"line":9,"offset":12}}},{"text":"errors","kind":"const","kindModifiers":"","spans":[{"start":{"line":8,"offset":18},"end":{"line":8,"offset":24}}],"nameSpan":{"start":{"line":8,"offset":18},"end":{"line":8,"offset":24}}},{"text":"name","kind":"var","kindModifiers":"","spans":[{"start":{"line":6,"offset":53},"end":{"line":6,"offset":57}}],"nameSpan":{"start":{"line":6,"offset":53},"end":{"line":6,"offset":57}}},{"text":"otherProps","kind":"var","kindModifiers":"","spans":[{"start":{"line":6,"offset":67},"end":{"line":6,"offset":80}}],"nameSpan":{"start":{"line":6,"offset":70},"end":{"line":6,"offset":80}}},{"text":"rules","kind":"var","kindModifiers":"","spans":[{"start":{"line":6,"offset":59},"end":{"line":6,"offset":64}}],"nameSpan":{"start":{"line":6,"offset":59},"end":{"line":6,"offset":64}}}]},{"text":"TestProps","kind":"type","kindModifiers":"export","spans":[{"start":{"line":4,"offset":1},"end":{"line":4,"offset":95}}],"nameSpan":{"start":{"line":4,"offset":13},"end":{"line":4,"offset":22}}},{"text":"useFormContext","kind":"alias","kindModifiers":"","spans":[{"start":{"line":2,"offset":39},"end":{"line":2,"offset":53}}],"nameSpan":{"start":{"line":2,"offset":39},"end":{"line":2,"offset":53}}}]}}
  • <semantic> Log extract
Perf 5009 [10:42:43.636] 938::quickinfo: elapsed time (in milliseconds) 2.3213
Info 5010 [10:42:43.636] response:
    {"seq":0,"type":"response","command":"quickinfo","request_seq":938,"success":true,"body":{"kind":"","kindModifiers":"","start":{"line":11,"offset":3},"end":{"line":11,"offset":6},"displayString":"any","documentation":[],"tags":[]}}
Info 5011 [10:42:43.793] request:
    {"seq":939,"type":"request","command":"getCodeFixes","arguments":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx","startLine":11,"startOffset":3,"endLine":11,"endOffset":6,"errorCodes":[2304]}}
Perf 5012 [10:42:43.798] 939::getCodeFixes: elapsed time (in milliseconds) 5.3185
Info 5013 [10:42:43.798] response:
    {"seq":0,"type":"response","command":"getCodeFixes","request_seq":939,"success":true,"body":[]}
Info 5014 [10:42:43.989] request:
    {"seq":940,"type":"request","command":"definitionAndBoundSpan","arguments":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx","line":11,"offset":6}}
Perf 5015 [10:42:43.990] 940::definitionAndBoundSpan: elapsed time (in milliseconds) 1.2371
Info 5016 [10:42:43.991] response:
    {"seq":0,"type":"response","command":"definitionAndBoundSpan","request_seq":940,"success":true,"body":{"definitions":[]}}
Info 5017 [10:42:45.165] request:
    {"seq":941,"type":"request","command":"updateOpen","arguments":{"changedFiles":[{"fileName":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx","textChanges":[{"newText":"","start":{"line":11,"offset":1},"end":{"line":12,"offset":1}}]}],"closedFiles":[],"openFiles":[]}}
Perf 5018 [10:42:45.165] 941::updateOpen: elapsed time (in milliseconds) 0.2105
Info 5019 [10:42:45.165] response:
    {"seq":0,"type":"response","command":"updateOpen","request_seq":941,"success":true,"body":true}
Info 5020 [10:42:45.267] request:
    {"seq":942,"type":"request","command":"geterr","arguments":{"delay":0,"files":["/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx"]}}
Perf 5021 [10:42:45.267] 942::geterr: async elapsed time (in milliseconds) 0.3747
Info 5022 [10:42:45.267] Starting updateGraphWorker: Project: /Users/olivier/Developer/react/sandbox/test-ts-perf/tsconfig.json
Info 5023 [10:42:45.273] Finishing updateGraphWorker: Project: /Users/olivier/Developer/react/sandbox/test-ts-perf/tsconfig.json Version: 157 structureChanged: false structureIsReused:: Completely Elapsed: 6.119924068450928ms
Info 5024 [10:42:45.273] Different program with same set of files
Info 5025 [10:42:45.274] event:
    {"seq":0,"type":"event","event":"syntaxDiag","body":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx","diagnostics":[]}}
Info 5026 [10:42:46.565] event:
    {"seq":0,"type":"event","event":"semanticDiag","body":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx","diagnostics":[]}}
Info 5027 [10:42:46.569] event:
    {"seq":0,"type":"event","event":"suggestionDiag","body":{"file":"/Users/olivier/Developer/react/sandbox/test-ts-perf/src/Test.tsx","diagnostics":[{"start":{"line":1,"offset":8},"end":{"line":1,"offset":13},"text":"'React' is declared but its value is never read.","code":6133,"category":"suggestion","reportsUnnecessary":true},{"start":{"line":8,"offset":16},"end":{"line":8,"offset":26},"text":"'errors' is declared but its value is never read.","code":6133,"category":"suggestion","reportsUnnecessary":true}]}}
Info 5028 [10:42:46.569] event:
    {"seq":0,"type":"event","event":"requestCompleted","body":{"request_seq":942}}

Reproduction:

  • npm init vite@latest test-ts-perf -- --template react-ts
  • npm add react-hook-form
  • create src/Test.tsx
import React, {FunctionComponent, HTMLProps} from 'react';
import { Controller, ControllerProps, useFormContext} from 'react-hook-form';

export type TestProps = Pick<ControllerProps, 'name' | 'rules'> & HTMLProps<HTMLInputElement>;

export const Test: FunctionComponent<TestProps> = ({name, rules,  ...otherProps}) => {
  const {
    formState: { errors },
    control,
  } = useFormContext();
  return (
    <>
      <Controller
        name={name}
        control={control}
        rules={rules}
        render={({ field }) => <input {...otherProps} {...field} />}
      />
    </>
  );
};

Diagnostics

▶ npx tsc --extendedDiagnostics
Files:                          85
Lines of Library:            28155
Lines of Definitions:        25202
Lines of TypeScript:            80
Lines of JavaScript:             0
Lines of JSON:                   0
Lines of Other:                  0
Nodes of Library:           117047
Nodes of Definitions:        58437
Nodes of TypeScript:           332
Nodes of JavaScript:             0
Nodes of JSON:                   0
Nodes of Other:                  0
Identifiers:                 60859
Symbols:                    114430
Types:                      129390
Instantiations:             423672
Memory used:               171359K
Assignability cache size:    68671
Identity cache size:           183
Subtype cache size:             12
Strict subtype cache size:       0
I/O Read time:               0.02s
Parse time:                  0.45s
ResolveModule time:          0.02s
ResolveTypeReference time:   0.01s
Program time:                0.52s
Bind time:                   0.20s
Check time:                  3.31s
printTime time:              0.00s
Emit time:                   0.00s
Total time:                  4.03s

Using combination of prisma, trpc, zod, react-hook-form. About 12 prisma models so I guess its a lot of generated code. TS version 4 and 5 destroy my CPU with constant 100% utilization. If I downgrade to TS version < 4.5 the issue goes away but I lose all the type inference (zod requires 4.5+) 😕 Please fix performance issue

Edit: I think I figured out a workaround, downgrading to zod 3.19.1 and TS 4.1, seems like the issue is fixed for me

Same here, also using react-hook-form in a project of around 300-400 files. Super slow intellisense and compilation on Windows

@andrewbranch I’ve created a project which I’ve adapted from some production source code: https://github.com/jonohill/tsc-bug-44851

On my (quite old) laptop, running tsc takes ~30s whereas with Typescript 4.2 (or commenting the documented line in main.ts) it only takes ~3s.

  1. Can anyone share a real project that’s having significant perf issues that I can use to investigate?
  2. @gravyboat if you disable semantic highlighting in your VS Code settings, do other editor features become reasonably usable or are they still slow?

I’m encountering this issue as well (latest stable Typescript release, latest VSCode release) and encodedSemanticClassifications is definitely the culprit according to the log, other calls in the log take milliseconds, where as this will be upwards of 1000ms per call which occurs multiple times when trying to use intellisense. I checked https://github.com/microsoft/TypeScript/issues/45824 where it seems as though ajv may be the culprit, but after removing the two packages that rely on it (eslint and react-hook-forms) performance wasn’t any better.

Info 556  [12:17:59.744] request:
    {"seq":9,"type":"request","command":"encodedSemanticClassifications-full","arguments":{"file":"/OMITTED.tsx","start":4175,"length":3599,"format":"2020"}}
Perf 557  [12:18:01.017] 9::encodedSemanticClassifications-full: elapsed time (in milliseconds) 1273.2477
Info 574  [12:18:01.257] request:
    {"seq":18,"type":"request","command":"encodedSemanticClassifications-full","arguments":{"file":"OMITTED.tsx","start":4175,"length":3598,"format":"2020"}}
Info 575  [12:18:01.257] Starting updateGraphWorker: Project: /OMITTED/tsconfig.json
Info 576  [12:18:01.344] Finishing updateGraphWorker: Project: /OMITTED/tsconfig.json Version: 2 structureChanged: false structureIsReused:: Completely Elapsed: 86.58006697893143ms
Info 577  [12:18:01.344] Different program with same set of files
Perf 578  [12:18:02.290] 18::encodedSemanticClassifications-full: elapsed time (in milliseconds) 1033.5596
    {"seq":25,"type":"request","command":"encodedSemanticClassifications-full","arguments":{"file":"OMITTED.tsx","start":4175,"length":3599,"format":"2020"}}
Perf 610  [12:18:05.183] 25::encodedSemanticClassifications-full: elapsed time (in milliseconds) 1005.1217

I’m not sure what else to do at this point. I’ve disabled all plugins, I’ve checked to make sure the tsconfig.json is excluding files appropriately per the troubleshooting documentation, and I’ve removed the packages that others have said were the culprit without any performance improvement.

@armanio123 What is the status on addressing this? There hasn’t been an update for nearly 2 months. Is there any chance of simply reverting https://github.com/microsoft/TypeScript/pull/30639 for the 4.5 release as it’s already in beta, or any chance of a fix for this getting in to 4.5.0? I don’t want to use a different editor/TS version for a single project but waiting 3-5 seconds for each intellisense update isn’t feasible.

Edit: It seems like ajv may be used elsewhere such as in webpack but that isn’t something I can reasonably ditch, so there’s still some potential ajv may be the root culprit that is exacerbating this issue.

The slowness is caused by PR #30639. I’m still looking at options on how to avoid this.

Update: this may be related to TypeScript 4.3? After updating our codebase to TS43 VSCode’s Intellisense has slowed down to a crawl even when using 1.56.2.

Reverting to 1.56 fixed the slowness for me too. Didn’t seem to matter if I used TS 4.2 or 4.3.

language service

Hmm, I’m trying to figure out a way to repro it, it has to be a fairly large repo. Just out of curiosity, where can I find more info about TS language service being only single-threaded? I know node is a single thread but it also uses worker threads no?

What does the team consider to be a large project in terms of files, library lines, definition lines, etc?

I don’t have a great answer for this off the top of my head, but I think it might be illuminating to see the output of a tsc --extendedDiagnostics, since that gives us all of that information and more.

@andrewbranch I did go through the performance wiki (noted this in my original comment but should have clarified more) including a couple of hours trying various things in https://github.com/microsoft/TypeScript/wiki/Performance#investigating-issues before I posted originally. What does the team consider to be a large project in terms of files, library lines, definition lines, etc? I don’t consider this project to be especially large, but maybe I’m wrong there. I’ll see about running through the performance tracing again, maybe something will show up that can help.

Since text can be somewhat unclear I want to clarify I’m not questioning anything you’ve said or trying to argue about it (I agree with your comments). I’ve never encountered this problem before in any TS project so this sort of performance issue and the various components involved are totally new to me.

I’m hereby declaring this issue about perf issues with encodedSemanticClassifications.#46228

👍 Sounds good!

@andrewbranch I have already created the issue AJV slows the IntelliSense there and there is an example of project. The issue: https://github.com/ajv-validator/ajv/issues/1667 The example of a project: https://github.com/aarbmx6s/vscode-ajv-issue

I use this approach to comfortable working in VSCode: https://github.com/microsoft/TypeScript/issues/44851#issuecomment-873487095

Repeating my report about this here since #37746 was recently closed.


I’m trying to move on from 3.8.3 for a long time, because it’s the only version which does not kill my productivity. I have an extremely slow code completion in anything higher than 3.8.3. Currently the logs are from TS 4.4.2.

Sometimes resting the cursor over a property/method completely stucks TS server for seconds:

Perf 566  [01:39:04.841] 14::encodedSemanticClassifications-full: elapsed time (in milliseconds) 6612.9189

This is code completion when writing a dot after an object, after ~8 seconds I could finally see the property suggestion list:

Info 798  [02:05:51.334] Starting updateGraphWorker: Project: /home/work/Projects/hidden/core/tsconfig.json
Info 799  [02:05:51.380] Finishing updateGraphWorker: Project: /home/work/Projects/hidden/core/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed: 45.291651997715235ms
Info 800  [02:05:51.380] Different program with same set of files
Info 801  [02:05:51.382] getCompletionData: Get current token: 0.027127999812364578
Info 802  [02:05:51.382] getCompletionData: Is inside comment: 0.06167500093579292
Info 803  [02:05:51.382] getCompletionData: Get previous token: 0.03589100018143654
Info 804  [02:05:51.382] getCompletionsAtPosition: isCompletionListBlocker: 0.17612700164318085
Info 805  [02:05:55.188] getCompletionData: Semantic work: 3805.772270999849
Info 806  [02:05:55.189] getCompletionsAtPosition: getCompletionEntriesFromSymbols: 0.7570599988102913
Info 807  [02:05:55.639] IntelliCode plugin: successfully loaded model from /home/work/.vscode/extensions/visualstudioexptteam.vscodeintellicode-1.2.14/cache/1A3F919CD5B7725108B03C349630A1C82B03_4A84987F2428442A9EC84563BB2BC063
Info 808  [02:05:55.640] IntelliCode plugin: program found
Info 809  [02:05:55.640] IntelliCode plugin: source file found
Info 810  [02:05:55.641] IntelliCode plugin: determined type: "reducer".IAuthenticationForgotPasswordState
Info 811  [02:05:55.642] IntelliCode plugin: pushing prior access: email
Info 812  [02:05:55.653] IntelliCode plugin: prior accesses: email
Info 813  [02:05:55.653] IntelliCode plugin: sequences: N~email,N
Info 814  [02:05:55.653] IntelliCode plugin: sequences: N~email,N
Info 815  [02:05:55.653] IntelliCode plugin: added metadata {"Id":1630364755653,"ModelVersion":"typescript_1.5","Count":0,"FailureReason":"NotInModel","Class":"","InIf":false,"ElapsedTime":463.245825,"Methods":[],"PrevInvoc":"","ItemMetadata":{}} to completion result
Perf 816  [02:05:55.654] 95::completionInfo: elapsed time (in milliseconds) 4319.9144

Another test with VS Code Insiders:

Info 603  [02:19:20.988] Starting updateGraphWorker: Project: /home/work/Projects/hidden/core/tsconfig.json
Info 604  [02:19:21.034] Finishing updateGraphWorker: Project: /home/work/Projects/hidden/core/tsconfig.json Version: 3 structureChanged: false structureIsReused:: Completely Elapsed: 45.792923998087645ms
Info 605  [02:19:21.034] Different program with same set of files
Info 606  [02:19:21.035] getCompletionData: Get current token: 0.039069999009370804
Info 607  [02:19:21.035] getCompletionData: Is inside comment: 0.05014200136065483
Info 608  [02:19:21.035] getCompletionData: Get previous token: 0.04182099923491478
Info 609  [02:19:21.035] getCompletionsAtPosition: isCompletionListBlocker: 0.00338900089263916
Info 610  [02:19:25.077] getCompletionData: Semantic work: 4042.3234740011394
Info 611  [02:19:25.080] getCompletionsAtPosition: getCompletionEntriesFromSymbols: 1.3409719988703728
Perf 612  [02:19:25.081] 40::completionInfo: elapsed time (in milliseconds) 4093.2213
Info 613  [02:19:25.081] response:
    {"seq":0,"type":"response","command":"completionInfo","request_seq":40,"success":true,"performanceData":{"updateGraphDurationMs":45.792923998087645},"body":{"isGlobalCompletion":false,"isMemberCompletion":true,"isNewIdentifierLocation":false,"entries":[{"name":"email","kind":"property","kindModifiers":"","sortText":"11"},{"name":"error","kind":"property","kindModifiers":"optional","sortText":"11"},{"name":"isLoading","kind":"property","kindModifiers":"","sortText":"11"},{"name":"state","kind":"property","kindModifiers":"","sortText":"11"}]}}
Info 614  [02:19:25.082] request:
    {"seq":41,"type":"request","command":"encodedSemanticClassifications-full","arguments":{"file":"/home/work/Projects/hidden/core/authentication/effects/index.ts","start":2441,"length":3413,"format":"2020"}}
Perf 615  [02:19:27.203] 41::encodedSemanticClassifications-full: elapsed time (in milliseconds) 2121.3128

VS Code Insiders version:

Version: 1.60.0-insider
Commit: 44a4b19a910a287adef4daaeabcf68f2ba893c35
Date: 2021-08-30T11:36:28.164Z
Electron: 13.1.8
Chrome: 91.0.4472.164
Node.js: 14.16.0
V8: 9.1.269.39-electron.0
OS: Linux x64 5.10.61-1-lts snap

VS Code version:

Version: 1.59.1
Commit: 3866c3553be8b268c8a7f8c0482c0c0177aa8bfa
Date: 2021-08-19T11:54:37.513Z
Electron: 13.1.7
Chrome: 91.0.4472.124
Node.js: 14.16.0
V8: 9.1.269.36-electron.0
OS: Linux x64 5.10.61-1-lts snap

My main question is, how can I find out exactly what are the expressions in this project (70k+ LoC), that are creating these problems? Any help is much appreciated. Thank you!

Alright I’ve been looking into it and seems like it’s going to be complicated to optimize. All the problem is that typescript is doing a bit more work to relate conditional types (in this example the problem is with type UncheckedJSONSchemaType on file node_modules/ajv/dist/types/json-schema.d.ts)

Nevertheless, we can still get into a good performance by dividing the type into sub named types. I’ve done some tests and manage to get encodedSemanticClassifications-full to about a second just by doing that.

Check the gist with how the file look after testing: https://gist.github.com/armanio123/95a33f9ad3286a7d78590eb11af293c4

I don’t know much about the project, so all my types on the example are named just an alphabet letter.