microsoft / vscode

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

Screen flicker occurred on Rust project #196647

Closed nukopy closed 1 year ago

nukopy commented 1 year ago

Type: Performance Issue

Screen flicker occured on Rust project, but not on any other languages project.

Reproduce a issue:

  1. clone some rust project: github.com/startship/starship
  2. open this repository on VSCode
  3. open Rust code
  4. coding, window width changing

Screen flicker like this:

https://github.com/microsoft/vscode/assets/42367320/020b8dce-d156-4728-94d5-cb36a036b00a

VS Code version: Code 1.83.1 (f1b07bd25dfad64b0167beb15359ae573aecd2cc, 2023-10-10T23:57:32.750Z) OS version: Darwin arm64 23.1.0 Modes:

System Info |Item|Value| |---|---| |CPUs|Apple M1 Max (10 x 24)| |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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled| |Load (avg)|4, 4, 5| |Memory (System)|64.00GB (7.22GB free)| |Process Argv|--crash-reporter-id 67a27090-cfea-48f8-ad1e-a9f4fc0b89f6| |Screen Reader|yes| |VM|0%|
Process Info ``` CPU % Mem MB PID Process 18 262 7271 code main 6 66 7276 gpu-process 0 66 7277 utility-network-service 65 918 7279 window [1] (Startup Performance — data-processor) 0 66 7592 ptyHost 0 0 7874 zsh (figterm) 0 0 7894 /bin/zsh --login 46 197 7644 shared-process 0 0 14265 /bin/ps -ax -o pid=,ppid=,pcpu=,pmem=,command= 0 66 13495 fileWatcher [1] 0 197 13496 extensionHost [1] 0 66 13734 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/json-language-features/server/dist/node/jsonServerMain --node-ipc --clientProcessId=13496) 0 66 14098 electron-nodejs (/Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper (Plugin).app/Contents/MacOS/Code Helper (Plugin) --ms-enable-electron-run-as-node /Applications/Visual Studio Code.app/Contents/Resources/app/extensions/markdown-language-features/server/dist/node/workerMain --node-ipc --clientProcessId=13496) 32 66 14263 window [3] (Issue Reporter) ```
Workspace Info ``` | Window (Startup Performance — data-processor) | Folder (data-processor): more than 23420 files | File types: html(9210) o(4461) js(723) json(646) timestamp(499) d(449) | rmeta(386) rlib(188) bin(119) rs(49) | Conf files: github-actions(1); ```

Extensions: none

A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vshan820:30294714
vstes263cf:30335440
vscorecescf:30445987
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
vsaa593cf:30376535
pythonvs932:30410667
py29gd2263cf:30856253
vsclangdf:30486550
c4g48928:30535728
dsvsc012cf:30540253
pynewext54:30695312
azure-dev_surveyone:30548225
2e4cg342:30602488
89544117:30613380
showlangstatbar:30737416
03d35959:30757346
pythonfmttext:30731395
fixshowwlkth:30771522
showindicator:30805244
pythongtdpath:30769146
i26e3531:30792625
pythonnosmt12:30797651
pythonidxpt:30866567
pythonnoceb:30805159
copilotsettingc:30859502
synctok:30869157
dsvsc013:30795093
dsvsc014:30804076
pythonmhint1:30842940
dsvsc015:30845448
pythontestfixt:30871694
pythonregdiag2cf:30871583
pyreplss1:30865275
pythoncet0:30866520
2e7ec940:30870395
pythontbext0:30864172

hediet commented 1 year ago

Does this reproduce in other workspaces (languages) as well, or is this rust-specific?

nukopy commented 1 year ago

Yes, rust-specific on my local development environment at least. It happens even when all the VSCode extensions are disable.

However, this screen flickering doesn't always occur. Thus, it's hard to reproduce consistently. (Unfortunately, it doesn't occur right now while I'm writing this comment...) It's entirely possible that it's not rust-specific.

But, this screen flickering always occurs in the window where I'm writing code on Rust project. Even if I have multiple windows open, including Rust projects and, for instance, TypeScript and Go projects, the flickering always occurs only in the window with the Rust project.

Lately, this has been happening frequently while I'm working, and it's been distressing. I'd be happy to help, so could you tell me how to investigate this phenomenon on VSCode? What should I pay attention to the next time this phenomenon occurs?

Let me know if you need any more information.

deepak1556 commented 1 year ago

Can you provide the output of system_profiler SPDisplaysDataType. Do you have a multi monitor setup or using something like https://github.com/waydabber/BetterDisplay to get HiDPI ?

nukopy commented 1 year ago

I am using two external monitors with FHD and 4K resolutions. I'm not sure if it's related, but I am using an application MonitorControl to control display settings with DDC protocol, which might be similar to BetterDisplay (see a screenshot below).

image

Result of system_profiler SPDisplaysDataType is the following:

$ system_profiler SPDisplaysDataType 

Graphics/Displays:

    Apple M1 Max:

      Chipset Model: Apple M1 Max
      Type: GPU
      Bus: Built-In
      Total Number of Cores: 32
      Vendor: Apple (0x106b)
      Metal Support: Metal 3
      Displays:
        Color LCD:
          Display Type: Built-in Liquid Retina XDR Display
          Resolution: 3024 x 1964 Retina
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Automatically Adjust Brightness: No
          Connection Type: Internal
        PL2790:
          Resolution: 1920 x 1080 (1080p FHD - Full High Definition)
          UI Looks like: 1920 x 1080 @ 60.00Hz
          Mirror: Off
          Online: Yes
          Rotation: Supported
        DELL U3223QE:
          Resolution: 5120 x 2880 (5K/UHD+ - Ultra High Definition Plus)
          UI Looks like: 2560 x 1440 @ 60.00Hz
          Mirror: Off
          Online: Yes
          Rotation: Supported
deepak1556 commented 1 year ago

Can you clarify if the rust project window is placed on the primary built-in display or any of the external displays when the flickering happens. Can you try to narrow down if a particular display is trigger for the issue.

vscodenpa commented 1 year ago

This issue has been closed automatically because it needs more information and has not had recent activity. See also our issue reporting guidelines.

Happy Coding!

nukopy commented 1 year ago

Can you clarify if the rust project window is placed on the primary built-in display or any of the external displays when the flickering happens. Can you try to narrow down if a particular display is trigger for the issue.

@deepak1556 Screen flickering occurs on an external 4K display and doesn't occur on built-in Retina display. Output of the command system_profiler SPDisplaysDataType is the following:

$ system_profiler SPDisplaysDataType

Graphics/Displays:

    Apple M1 Max:

      Chipset Model: Apple M1 Max
      Type: GPU
      Bus: Built-In
      Total Number of Cores: 32
      Vendor: Apple (0x106b)
      Metal Support: Metal 3
      Displays:
        Color LCD:
          Display Type: Built-in Liquid Retina XDR Display
          Resolution: 3024 x 1964 Retina
          Main Display: Yes
          Mirror: Off
          Online: Yes
          Automatically Adjust Brightness: No
          Connection Type: Internal
        Pro Display XDR:
          Display Type: 2D backlit LCD
          Resolution: 6016 x 3384 Retina 6K
          Display Serial Number: C02GL03YML9W
          Display Firmware Version: 4.2.37
          Mirror: Off
          Online: Yes
          Automatically Adjust Brightness: Yes
deepak1556 commented 1 year ago

Thanks for testing, the relevant issue is tracked in https://github.com/microsoft/vscode/issues/165681

Can you check if the issue is resolved with our exploration build based on a newer version of the runtime.