vscode icon indicating copy to clipboard operation
vscode copied to clipboard

The built-in terminal in VSCode has poor performance

Open YexuanXiao opened this issue 2 weeks ago • 6 comments

The built-in terminal in VSCode has poor performance. When the system background load is high, the output becomes very slow. Additionally, the terminal output in VSCode also consumes a considerable amount of CPU, which can be observed by writing a test that outputs large amounts of content to the terminal every 15ms. In contrast, Windows Terminal consumes almost no CPU.

Steps to Reproduce:

  1. Output a large amount of content to the console.

YexuanXiao avatar Dec 09 '25 17:12 YexuanXiao

Same problem here, appearing recently (maybe the last week or so). I have a large csharp monorepo. Running the "build" task now takes ~8mins when it used to take <40sec.

I narrowed it down to the VS Code terminal. If I pipe output to /dev/null, it takes <40sec again. If I run the exact same task args in bash (Windows terminal, not the VS Code terminal), it takes <40sec regardless of piping output.

andysalerno avatar Dec 09 '25 19:12 andysalerno

Can you try setting "terminal.integrated.windowsUseConptyDll": true, restarting and trying again? That will bring us closer to the backend that Windows Terminal is on (but not fully up to date) which has a bunch of performance improvements.

If you still see problems, provide a more detailed repro include the command line, exact shell/versions, windows version, vscode version, the rough contents of the file (size, ascii only?)

Tyriar avatar Dec 10 '25 00:12 Tyriar

Can you try setting "terminal.integrated.windowsUseConptyDll": true, restarting and trying again? That will bring us closer to the backend that Windows Terminal is on (but not fully up to date) which has a bunch of performance improvements.

If you still see problems, provide a more detailed repro include the command line, exact shell/versions, windows version, vscode version, the rough contents of the file (size, ascii only?)

I don't think there's any improvement after setting it up, with VSCode version 1.106.3, PowerShell 7.5.4, and Windows 11 build 28000. You can execute the following in the console to demonstrate the performance difference:

$rng = [Random]::new(); while($true){ 1..100|%{'Random integer: {0}' -f $rng.Next()}; Start-Sleep -Milliseconds 15 }

YexuanXiao avatar Dec 10 '25 12:12 YexuanXiao

What makes you say that's slow? CPU use is fine from what I can see in task manager and looking at a performance trace shows that each parse is sub 1ms:

Image

Same with rendering:

Image

Tyriar avatar Dec 10 '25 13:12 Tyriar

What makes you say that's slow? CPU use is fine from what I can see in task manager and looking at a performance trace shows that each parse is sub 1ms:

Image

YexuanXiao avatar Dec 10 '25 15:12 YexuanXiao

@YexuanXiao can you share that trace via this button?

Image

Also do you have a very large terminal.integrated.scrollback by chance?

Tyriar avatar Dec 10 '25 16:12 Tyriar

@YexuanXiao can you share that trace via this button?

Also do you have a very large terminal.integrated.scrollback by chance?

The value for terminal.integrated.scrollback is 3000.

Trace-20251211T015000.zip

YexuanXiao avatar Dec 10 '25 17:12 YexuanXiao

This doesn't look so bad, note that setTimeout/clearTimeout which is the bulk of this trace are inflated when doing a perf profile:

Image

Can you define "considerable amount of CPU" and how you measured it?

Tyriar avatar Dec 10 '25 18:12 Tyriar

We closed this issue because we are unable to reproduce the problem with the steps you describe. Chances are we've already fixed your problem in a recent version of VS Code. If not, please ask us to reopen the issue and provide us with more detail. Our issue reporting guidelines might help you with that.

Happy Coding!