Repository navigation
Running code using the run button in VSC delayed #24239
Copy link
Copy link
Closed
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Description
Type: Performance Issue
Code executes only after a large delay on the newest version when excecuted from vsc's "run" button.
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
Behaviour
The command to run the script isn't inserted into the terminal until after a large delay. This doesn't happen if you manually do ctrl+F5 or F5.
Old perfromance: (v.2024.14.1)

New performance: (The only changed component is that this version is v.2024.16.0.

Steps to reproduce:
- If you run python code with the python extension v2024.16.0 by pressing the visual studio code run button, there is a severe delay until the program decides to excecute. Downgrading to v2024.14.1 directly solves the issue. This happens on windows.
Diagnostic data
Output for Python in the Output panel (View→Output, change the drop-down the upper-right of the Output panel to Python)
XXX
Extension version: 2024.14.1 (mistake, I reported the bug from the previous version, correct bugged version is 2024.16.0)
VS Code version: Code 1.94.0 (d78a74bcdfad14d5d3b1b782f87255d802b57511, 2024-10-02T13:08:12.626Z)
OS version: Windows_NT x64 10.0.22631
Modes:
- Python version (& distribution if applicable, e.g. Anaconda): 3.12.6
- Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
- Value of the
python.languageServersetting: Default
User Settings
languageServer: "Pylance"
Installed Extensions
| Extension Name | Extension Id | Version |
|---|---|---|
| JavaScript Debugger | ms-vscode.js-debug | 1.94.0 |
| JavaScript Debugger Companion Extension | ms-vscode.js-debug-companion | 1.1.3 |
| Pylance | ms-python.vscode-pylance | 2024.9.1 |
| Python | ms-python.python | 2024.14.1 |
| Python Debugger | ms-python.debugpy | 2024.10.0 |
| Table Visualizer for JavaScript Profiles | ms-vscode.vscode-js-profile-table | 1.0.10 |
System Info
| Item | Value |
|---|---|
| CPUs | AMD Ryzen 5 5600X 6-Core Processor (12 x 3700) |
| GPU Status | 2d_canvas: enabled canvas_oop_rasterization: enabled_on direct_rendering_display_compositor: disabled_off_ok gpu_compositing: enabled multiple_raster_threads: enabled_on opengl: enabled_on rasterization: enabled raw_draw: disabled_off_ok skia_graphite: disabled_off video_decode: enabled video_encode: enabled vulkan: disabled_off webgl: enabled webgl2: enabled webgpu: enabled webnn: disabled_off |
| Load (avg) | undefined |
| Memory (System) | 31.93GB (22.52GB free) |
| Process Argv | C:\Users\4f736\Desktop\Sourcetest\dev\canvasimage.py --crash-reporter-id 5f987fe4-e9aa-43c0-93ec-dc7ee6464594 |
| Screen Reader | no |
| VM | 0% |
Process Info
CPU % Mem MB PID Process
0 129 15332 code main
0 144 5916 ptyHost
0 7 1908 conpty-agent
0 7 2084 conpty-agent
0 73 3100 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 66 7140 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 68 8348 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 7 8680 conpty-agent
0 66 9280 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 7 9656 conpty-agent
0 66 13576 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 6 16600 conpty-agent
0 66 16620 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 66 16840 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 7 17056 conpty-agent
0 6 17332 conpty-agent
0 69 18072 C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -noexit -command "try { . \"c:\Users\4f736\AppData\Local\Programs\Microsoft VS Code\resources\app\out\vs\workbench\contrib\terminal\common\scripts\shellIntegration.ps1\" } catch {}"
0 7 19256 conpty-agent
0 104 5936 window
0 123 6376 shared-process
0 134 7224 gpu-process
0 86 12752 fileWatcher [1]
0 169 12812 extensionHost [1]
0 5 4868 c:\Users\4f736\.vscode\extensions\ms-python.python-2024.14.1-win32-x64\python-env-tools\bin\pet.exe server
0 10 6460 C:\Windows\system32\conhost.exe 0x4
0 186 13788 electron-nodejs (bundle.js )
0 289 13152 window [1] (Extension: Python - Visual Studio Code)
0 31 16932 crashpad-handler
0 48 19268 utility-network-service
Workspace Info
;
A/B Experiments
vsliv368:30146709
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
binariesv615:30325510
vsaa593:30376534
py29gd2263:31024239
vscaat:30438848
c4g48928:30535728
azure-dev_surveyone:30548225
962ge761:30959799
pythongtdpath:30769146
welcomedialogc:30910334
pythonnoceb:30805159
asynctok:30898717
pythonmypyd1:30879173
h48ei257:31000450
pythontbext0:30879054
accentitlementsc:30995553
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
cppperfnew:31000557
dsvsc020:30976470
pythonait:31006305
dsvsc021:30996838
9c06g630:31013171
a69g1124:31058053
dvdeprecation:31068756
dwnewjupyter:31046869
impr_priority:31102340
nativerepl1:31139838
refactort:31108082
pythonrstrctxt:31112756
flighttreat:31134774
wkspc-onlycs-t:31132770
wkspc-ranged-t:31151552
cf971741:31144450
autoexpandse:31146404
iacca2:31150323
notype1cf:31151524
cc771715:31146322
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
info-neededIssue requires more information from posterIssue requires more information from postertriage-neededNeeds assignment to the proper sub-teamNeeds assignment to the proper sub-team
Activity
karthiknadig commentedon Oct 4, 2024
Anthony Kim (@anthonykim1) This looks like Shell integration taking too long. If we need to use
sendTextonce, we should just disable shell integration from that point onwards.starball5 commentedon Oct 4, 2024
Related on Stack Overflow: VS Code 1.94 - Run selection/line in Python terminal very slow
anthonykim1 commentedon Oct 4, 2024
Thanks for filing this FraidOfWater. I'm looking into resolving this. Could you set your log level to trace and share the logs for Python?
Wait 0.5 second for shell integration event, otherwise fall back to s…
FraidOfWater commentedon Oct 4, 2024
Hey Anthony Kim (@anthonykim1) , thanks for replying. Here is my VSC stack trace for python. I hope this is what you meant. It was my mistake for not including it. https://pastebin.com/pxPePWgX
Edit: I seem to have posted the diagnostic data wrong. It says Extension version: 2024.14.1 although It is really 2024.16.0. I must've downgraded and reported it then. I have added corrected diagnostic data at the end.
Edit: Full trace logs here (I figured how to set it as default so it traces when starting up VSC):
Note: here the we are trying to run a simpler program "Hello World!".
https://pastebin.com/TJPx7hP8 Old version
https://pastebin.com/k0zuWMHh New version
I do get this new delay also on another machine.
Note I turn tracing on only after VSC has started with ">Developert:Set Log Level" to trace all
This is what happens with the old version:
This is what happens in the new version:
It looks like the lines from the old version:
and the lines from the new version:
don't match
for repeated pressing, I seem to get this as the only difference:
Also I do not know the significance of this, but for both versions I do get this error next to the terminal

Correct diagnostic data:
Note: I have added extensions to run java, sorry for that. I don't think there are any other changes to this data.
Extension version: 2024.16.0
VS Code version: Code 1.94.0 (d78a74bcdfad14d5d3b1b782f87255d802b57511, 2024-10-02T13:08:12.626Z)
OS version: Windows_NT x64 10.0.22631
Modes:
python.languageServersetting: PylanceUser Settings
Installed Extensions
System Info
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off
A/B Experiments
Wait 0.5 second for shell integration event, otherwise fall back to s…
Wait 0.5 second for shell integration event, otherwise fall back to s…
anthonykim1 commentedon Nov 11, 2024
Could you try the latest pre-release version of Python extension? This would've gotten better with #24248
Let me know if you have any complains. Thanks!
FraidOfWater commentedon Nov 12, 2024
Yeah you guys fixed it already in version 16.1 it seems! Super smooth now, all good, cheers!
anthonykim1 commentedon Nov 12, 2024
Happy to hear that, please let us know here or in new issue if this problem ever occurs again :)