microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
163.58k stars 29.03k forks source link

Terminal is very slow when output contains many urls on a single line #221351

Closed shinohara-rin closed 2 months ago

shinohara-rin commented 3 months ago

Type: Performance Issue

VSCode will become unresponsive for a few seconds if you hover on a url that has many other urls on the same line. This is especially problematic when outputing a huge single-line json that contains multiple urls.

image

Steps to reproduce:

  1. Have something that contains a lot of urls on a single line in your terminal, for example run this python script:
    url = "[https://example.com]"
    print(url*5000)
  2. Hover your cursor on any of the urls in the integrated terminal.
  3. You should observe VSCode hangs for a moment.

VS Code version: Code - Insiders 1.92.0-insider (Universal) (8703a11164db333db471576d38ddc143d6ad7ead, 2024-07-10T08:26:11.347Z) OS version: Darwin arm64 22.4.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 (8 x 2400)| |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
webgl: enabled
webgl2: enabled
webgpu: enabled
webnn: disabled_off| |Load (avg)|2, 3, 3| |Memory (System)|8.00GB (0.14GB free)| |Process Argv|| |Screen Reader|no| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 14 172 44578 code-insiders main 0 57 44588 gpu-process 0 33 44589 utility-network-service 0 188 44598 window [1] (github-issue-search) 0 66 44619 shared-process 0 0 44840 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 49 44670 fileWatcher [1] 0 74 44671 extensionHost [1] 0 49 44690 ptyHost 0 0 44692 /opt/homebrew/bin/fish -l 0 98 44833 window [2] (Issue Reporter) ```

Extensions: none

A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscod805:30301674
vsaa593:30376534
py29gd2263:31024238
c4g48928:30535728
2i9eh265:30646982
962ge761:30841072
pythongtdpath:30726887
welcomedialog:30812478
pythonnoceb:30776497
asynctok:30898717
dsvsc013:30777762
dsvsc014:30777825
dsvsc015:30821418
pythonregdiag2:30926734
pythonmypyd1:30859725
2e7ec940:31000449
pythontbext0:30879054
accentitlementst:30870582
dsvsc016:30879898
dsvsc017:30880771
dsvsc018:30880772
cppperfnew:30980852
pythonait:30973460
jchc7451:31067543
chatpanelt:31014475
724cj586:31013169
a69g1124:31018687
dvdeprecation:31040973
dwnewjupytercf:31046870
impr_priority:31057980
nativerepl2:31071685
refactort:31084545
pythonrstrctxt:31089940
4930e709:31088354
hdi1a554:31091669

johan-boule commented 2 months ago

Here the terminal is literally 12,000 bauds for my usual build logs, no kidding. I might go back to 1978 and enjoy the better performance of a VT100 running at 19,200 bauds. I wish that was a joke, but that's the reality.

Tyriar commented 2 months ago

Can reproduce, it locks up here:

image