Repository: TypeScript
Issue: Long running encodedSemanticClassifications-full request with @discordjs/voice
Labels: Needs Investigation,Domain: Performance

Issue Type: <b>Performance Issue</b>

JavaScript autocomplete becomes very slow and uses a lot of cpu.
Steps to reproduce:
I am using the Discord.JS library, and the VoiceConnection object uses events which are not named with strings but objects.
For example: 
(method) TypedEmitter<VoiceConnectionEvents>.on<VoiceConnectionStatus.Disconnected>(event: VoiceConnectionStatus.Disconnected, listener: (oldState: VoiceConnectionState, newState: (VoiceConnectionDisconnectedOtherState & {
    ...;
}) | (VoiceConnectionDisconnectedWebSocketState & {
    ...;
})) => Awaited<...>): VoiceConnection

It seems to me that if I bind an event to this emitter, the autocomplete becomes slow.
Example:
this.voice_connection.on(VoiceConnectionStatus.Disconnected, (old_state, new_state)=>{
            if(this.state=="PLAYING"){
                this.pause();
            }
        });
However if I comment this out it stops lagging.
I reproduced this with extensions disabled.

VS Code version: Code 1.66.2 (dfd34e8260c270da74b5c2d86d61aee4b6d56977, 2022-04-11T07:46:01.075Z)
OS version: Windows_NT x64 10.0.19043
Restricted Mode: No

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|AMD Ryzen 5 2600X Six-Core Processor            (12 x 3593)|
|GPU Status|2d_canvas: enabled<br>canvas_oop_rasterization: disabled_off<br>direct_rendering_display_compositor: disabled_off_ok<br>gpu_compositing: enabled<br>multiple_raster_threads: enabled_on<br>oop_rasterization: enabled<br>opengl: enabled_on<br>rasterization: enabled<br>raw_draw: disabled_off_ok<br>skia_renderer: enabled_on<br>video_decode: enabled<br>video_encode: enabled<br>vulkan: disabled_off<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|undefined|
|Memory (System)|15.95GB (8.38GB free)|
|Process Argv|--crash-reporter-id 47a451dd-9d7e-42a4-85ae-b917b84d9992|
|Screen Reader|no|
|VM|0%|
</details><details>
<summary>Process Info</summary>

```
CPU %	Mem MB	   PID	Process
    0	    95	 13412	code main
    0	   121	  7776	   extensionHost
    0	   703	  8776	     "C:\Program Files\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --useInferredProjectPerProjectRoot --enableTelemetry --cancellationPipeName C:\Users\kecsk\AppData\Local\Temp\vscode-typescript\a1f96df8b23d1affac48\tscancellation-c5c1e941f078bbe6e437.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	    94	  9872	       "C:\Program Files\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node "c:/Program Files/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typingsInstaller.js" --globalTypingsCacheLocation C:/Users/kecsk/AppData/Local/Microsoft/TypeScript/4.6 --enableTelemetry --typesMapLocation "c:/Program Files/Microsoft VS Code/resources/app/extensions/node_modules/typescript/lib/typesMap.json" --validateDefaultNpmLocation
    0	   121	 22200	     "C:\Program Files\Microsoft VS Code\Code.exe" --ms-enable-electron-run-as-node --max-old-space-size=3072 "c:\Program Files\Microsoft VS Code\resources\app\extensions\node_modules\typescript\lib\tsserver.js" --serverMode partialSemantic --useInferredProjectPerProjectRoot --disableAutomaticTypingAcquisition --cancellationPipeName C:\Users\kecsk\AppData\Local\Temp\vscode-typescript\a1f96df8b23d1affac48\tscancellation-4b1f8abb5201e1af6356.tmp* --locale en --noGetErrOnBackgroundUpdate --validateDefaultNpmLocation --useNodeIpc
    0	   101	 16984	   shared-process
    0	    81	 14868	     fileWatcher
    0	    76	 18272	     ptyHost
    0	    69	 14368	       C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe
    0	     6	 24380	       console-window-host (Windows internal process)
    0	   126	 19692	   gpu-process
    0	    38	 20580	   utility-network-service
    0	    88	 21564	   issue-reporter
    0	    26	 22972	   crashpad-handler
    0	   221	 23236	   window (audio_cache.ts - bot - Visual Studio Code)
```

</details>
<details>
<summary>Workspace Info</summary>

```
|  Window (audio_cache.ts - bot - Visual Studio Code)
|    Folder (bot): 48 files
|      File types: ts(20) json(3) opus(2) dockerignore(1) gitignore(1) m4a(1)
|      Conf files: dockerfile(1) package.json(1);
```

</details>
Extensions: none<details>
<summary>A/B Experiments</summary>

```
vsliv368:30146709
vsreu685:30147344
python383:30185418
vspor879:30202332
vspor708:30202333
vspor363:30204092
vswsl492:30256859
pythonvspyl392:30443607
pythontb:30283811
pythonptprofiler:30281270
vshan820:30294714
vstes263:30335439
vscoreces:30445986
pythondataviewer:30285071
vscod805cf:30301675
pythonvspyt200:30340761
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
vsc1dst:30438360
pythonvs932:30410667
wslgetstarted:30449410
pythonvsnew555:30457759
vscscmwlcmt:30465135
cppdebug:30475216

```

</details>

<!-- generated by issue reporter -->