Open Austint30 opened 8 months ago
Is this about writing output really quickly, or writing huge amounts of text to the console, not necessarily quickly? A simple test script would help
Upon testing an example script I wrote, it seems the slowdown issues does not happen when using the Python Debugger: Python File configuration as nothing is written to the Debug Console. However, using debugpy does trigger this to happen. I've updated my original post adding an example script, launch.json and adding the debugpy step.
@roblourens Just in case you didn't see it, the script I have added to my post reproduces the issue and causes vscode to slow down and then freeze. Make sure you use debugpy when running the script so you can attach a debugger to it. I've also updated the steps to reproduce.
@roblourens Hey Rob, have you been able to reproduce this issue yet?
I see that- it's about having a really long line. If I change the \r
to \n
so the output is on different lines, then it seems fine. Profiled just a little, seems like this line is slow https://github.com/microsoft/vscode/blob/8098a783f2a35e28f36d67522bbe7e45140528b8/src/vs/workbench/contrib/debug/common/replModel.ts#L307-L308
and also I wonder whether this async queue slows event handling down https://github.com/microsoft/vscode/blob/8098a783f2a35e28f36d67522bbe7e45140528b8/src/vs/workbench/contrib/debug/browser/debugSession.ts#L1132 maybe it can execute sync when the queue is empty, or maybe it can merge multiple accumulated output events?
Does this issue occur when all extensions are disabled?: Yes
Steps to Reproduce:
python -m debugpy --listen 5678 --wait-for-client ./script.py
VSCode will slow down and eventually freeze up.
This also affects scripts that output a lot of text that overwrites the current line. In my case I have a script that sifts through hundreds of thousands of records and displays a count indicating its progress.
Here is an example script and launch.json file:
Script:
launch.json
Note: the slowdown can be temporarily fixed by clearing the debug console. But if you have a script constantly outputting text you're going to need to be clicking it constantly to prevent VSCode from freezing.
This GitHub issue was closed because it was fixed apparently https://github.com/microsoft/vscode/issues/19678. But, it seems it was fixed by clearing the debug console when the debug session starts. I think this needs to be further improved upon and clear the oldest N lines so VSCode doesn't lock up.