The Wayback Machine - https://web.archive.org/web/20210117095127/https://github.com/microsoft/vscode/issues/107016
Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Slow reponse to scroll and typing #107016

Open
RLesma opened this issue Sep 18, 2020 · 78 comments
Open

Slow reponse to scroll and typing #107016

RLesma opened this issue Sep 18, 2020 · 78 comments

Comments

@RLesma
Copy link

@RLesma RLesma commented Sep 18, 2020

Issue Type: Performance Issue

It is not slow to start-up, it is slow to do anything in the text editor (scroll, find, type, etc). For example, when scrolling, the screen is unable to keep up with the mouse wheel and it will keep scrolling for a while after I stop the mouse wheel. I disabled the extensions I installed lately, and also reduced the amount of files in the workspace.

VS Code version: Code 1.49.1 (58bb7b2, 2020-09-16T23:27:51.792Z)
OS version: Windows_NT x64 10.0.19041

System Info
Item Value
CPUs Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz (4 x 2712)
GPU Status 2d_canvas: enabled
flash_3d: enabled
flash_stage3d: enabled
flash_stage3d_baseline: enabled
gpu_compositing: enabled
multiple_raster_threads: enabled_on
oop_rasterization: disabled_off
opengl: enabled_on
protected_video_decode: enabled
rasterization: enabled
skia_renderer: disabled_off_ok
video_decode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
Load (avg) undefined
Memory (System) 11.85GB (4.20GB free)
Process Argv --crash-reporter-id 2c01e348-504e-456f-931c-280aa8926a03
Screen Reader no
VM 0%
Process Info
CPU %	Mem MB	   PID	Process
    2	    96	 33588	code main
    2	    88	 13340	   shared-process
    3	    84	 26656	   window (Issue Reporter)
    0	    24	 27836	   crashpad-handler
    0	   223	 30908	   window (Settings - local_svn_workspace (Workspace) - Visual Studio Code)
    0	    11	  6640	     watcherService 
    0	     6	 12092	       console-window-host (Windows internal process)
    0	     6	  9240	     console-window-host (Windows internal process)
    0	    96	 19504	     extensionHost
    0	    69	 30740	     C:\WINDOWS\System32\WindowsPowerShell\v1.0\powershell.exe
    0	    60	 30924	   utility
    1	   241	 33368	   gpu-process
Workspace Info
|  Window (Settings - local_svn_workspace (Workspace) - Visual Studio Code)
|    Folder (JESD204): 1760 files
|      File types: svn-base(998) v(161) sv(38) sh(33) tcl(30) prj(30) do(25)
|                  tmp(9) txt(9) log(7)
|      Conf files: makefile(7);
Extensions (11)
Extension Author (truncated) Version
better-comments aar 2.1.0
bracket-pair-colorizer Coe 1.0.61
ctags-support jay 1.0.19
svn-scm joh 2.12.4
rainbow-csv mec 1.7.1
remote-ssh ms- 0.55.0
remote-ssh-edit ms- 0.55.0
remote-wsl ms- 0.44.5
veriloghdl msh 1.3.3
awesome-vhdl puo 0.0.1
tcl ras 0.1.0
@alexdima
Copy link
Member

@alexdima alexdima commented Sep 18, 2020

@RLesma Does this reproduce when disabling all extensions? Press F1 and then choose Developer: Reload Window with Extensions Disabled

Kapture 2020-07-20 at 15 28 23

@jonas-jonas
Copy link

@jonas-jonas jonas-jonas commented Sep 20, 2020

I do have this issue now too. I don't think I had in any previous version. My observations:

  • It's fine when the file is small (50 lines is fine)
  • File type did not matter, I had the issue in a lorem ipsum filled txt file
  • Slow when all extensions are disabled, I coincidentally had to reinstall my OS (Windows 10) yesterday and the issue persists.
  • I did a performance monitoring run while fast scrolling through a 700 lines file (lorem ipsum text) with extensions disabled and FPS dropped to 0 at some point. The results are here: https://gist.github.com/jonas-jonas/b0915211b146619cfbffeceed5deb117

Edit: My "about" information:
Version: 1.49.0 (user setup)
Commit: e790b93
Date: 2020-09-10T13:22:08.892Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

Hope this helps!

@EusthEnoptEron
Copy link

@EusthEnoptEron EusthEnoptEron commented Sep 21, 2020

I also noticed some lagginess when typing / scrolling on my end (1.49.1).

  • Downgrading to 1.48.2 seems to have fixed the issue for me.
  • I also tried upgrading to 1.49.1 again, but it was still as laggy, so I went back to 1.48.2.
@krenton
Copy link

@krenton krenton commented Sep 21, 2020

Experiencing the same problem. My about info:

Version: 1.49.1 (user setup)
Commit: 58bb7b2331731bf72587010e943852e13e6fd3cf
Date: 2020-09-16T23:27:51.792Z
Electron: 9.2.1
Chrome: 83.0.4103.122
Node.js: 12.14.1
V8: 8.3.110.13-electron.0
OS: Windows_NT x64 10.0.19041

Significant performance drop when editing files that have some sort of syntax highlighting.
XML files were the worst; markdown was fine, but got worse when I added code snippets.

Recorded performance while typing/scrolling and saw a lot of warnings about "cumulative layout shift".
Downgraded to version 1.48.2 - the problem is gone. Also no more "cumulative layout shift" warnings in performance recordings.

Edit:
Actually checked: version 1.48.2 does have a small typing delay for me. Switching to 1.47.3 turned out to be the best experience.

@github-actions github-actions bot removed the new release label Sep 22, 2020
@RLesma
Copy link
Author

@RLesma RLesma commented Sep 22, 2020

@RLesma Does this reproduce when disabling all extensions? Press F1 and then choose Developer: Reload Window with Extensions Disabled

Kapture 2020-07-20 at 15 28 23

I just did that, and it is still slow. Definitely not an extension issue.

@RLesma
Copy link
Author

@RLesma RLesma commented Sep 22, 2020

Downgrading to 1.48.2 also solved the issue for me.

@alexdima
Copy link
Member

@alexdima alexdima commented Sep 22, 2020

@deepak1556 Would you need more info here ? (this seems similar to #106456 , #106939 which are all on Windows)

@deepak1556
Copy link
Contributor

@deepak1556 deepak1556 commented Sep 23, 2020

Thanks to the traces from @Minkyu-Choi and @Perh0rd , I was able to see a problematic area during the scroll operation.

Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::AccessibilityIsIgnored
Code - Insiders.exe!blink::AXObjectCacheImpl::FireAXEventImmediately
Code - Insiders.exe!blink::AXNodeObject::ChildrenChanged
Code - Insiders.exe!blink::AXObjectCacheImpl::ChildrenChanged
Code - Insiders.exe!blink::AXObjectCacheImpl::FireTreeUpdatedEventImmediately
Code - Insiders.exe!blink::AXObjectCacheImpl::ProcessUpdates
Code - Insiders.exe!blink::AXObjectCacheImpl::ProcessDeferredAccessibilityEvents
Code - Insiders.exe!blink::LocalFrameView::ForAllNonThrottledLocalFrameViews<`lambda at ../../third_party/blink/renderer/core/frame/local_frame_view.cc:2664:37'>
Code - Insiders.exe!blink::LocalFrameView::RunAccessibilityLifecyclePhase
Code - Insiders.exe!blink::LocalFrameView::UpdateLifecyclePhasesInternal
Code - Insiders.exe!blink::LocalFrameView::UpdateLifecyclePhases
Code - Insiders.exe!blink::PageAnimator::UpdateAllLifecyclePhases
Code - Insiders.exe!blink::WebViewImpl::UpdateLifecycle
Code - Insiders.exe!blink::WidgetBase::UpdateVisualState
Code - Insiders.exe!cc::LayerTreeHost::RequestMainFrameUpdate
Code - Insiders.exe!cc::ProxyMain::BeginMainFrame
Code - Insiders.exe!base::internal::Invoker<base::internal::BindState<void (cc::ProxyMain::*)(std::__1::unique_ptr<cc::BeginMainFrameAndCommitState,std::__1::default_delete<cc::BeginMainFrameAndCommitState>>),base::WeakPtr<cc::ProxyMain>,std::__1::unique_ptr<cc::BeginMainFrameAndCommitState,std::__1::default_delete<cc::BeginMainFrameAndCommitState>>>,void ()>::RunOnce
Code - Insiders.exe!base::TaskAnnotator::RunTask
Code - Insiders.exe!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl
Code - Insiders.exe!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork
Code - Insiders.exe!base::MessagePumpDefault::Run
Code - Insiders.exe!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run
Code - Insiders.exe!base::RunLoop::Run
Code - Insiders.exe!content::RendererMain
Code - Insiders.exe!content::ContentMainRunnerImpl::Run
Code - Insiders.exe!service_manager::Main
Code - Insiders.exe!content::ContentMain
Code - Insiders.exe!wWinMain
Code - Insiders.exe!__scrt_common_main_seh
kernel32.dll!?
ntdll.dll!?
[Root]

I was not able to find the same stack in a trace from my local dev box, the AXObject is something that gets constructed for accessibility tree in the renderer, this gave a clue as to maybe the problem happens when accessibility is involved. Turning on the screen reader and performing the scroll did create the same stack along with a visible slowdown.

This brings me to my question, is everyone here seeing the issue had screen reader enabled ?

@Minkyu-Choi
Copy link

@Minkyu-Choi Minkyu-Choi commented Sep 23, 2020

@deepak1556 Do you mean narrator enabled? Then, narrator is disabled.
Also, I felt better scrolling when I used 1.48.2 version with same windows environment.
Thank you for your work.

@deepak1556
Copy link
Contributor

@deepak1556 deepak1556 commented Sep 23, 2020

Thanks for confirming, one more thing to try, can you launch with code-insiders --disable-features="LayoutNG" and check if the scroll is any better ?

@Minkyu-Choi
Copy link

@Minkyu-Choi Minkyu-Choi commented Sep 23, 2020

Unfortunately, scroll behaved same with that option.

@alexdima
Copy link
Member

@alexdima alexdima commented Sep 23, 2020

@deepak1556 I have seen this in the past -- electron/electron#7208 . Electron would enter accessibility mode on laptops with touch screens. IIRC the root problem was that on Windows there was no clear API to find out if a Screen Reader is attached, and the way to determine that was by checking some Windows events if they appeared to be similar to the ones that Screen Readers typically send. I'm not saying this is the same issue, but in that case there was also a lot of slowness experienced. So IMHO I think there are 2 issues here:

  • why is Chromium so slow when it enables accessibility mode -- that should not be the case
  • why is Chromium/Electron enabling accessibility mode -- we might want to look into adding Electron API such that we can disable it entirely and offer a flag or option for people experiencing problems with this to disable it completely. I also remember that Electron had some custom code here on top of Chromium so maybe that one no longer works correctly?
@RLesma
Copy link
Author

@RLesma RLesma commented Sep 23, 2020

Thanks to the traces from @Minkyu-Choi and @Perh0rd , I was able to see a problematic area during the scroll operation.

Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::HasInheritedPresentationalRole
Code - Insiders.exe!blink::AXNodeObject::InheritsPresentationalRoleFrom
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::BackgroundColor
Code - Insiders.exe!blink::AXLayoutObject::ComputeBackgroundColor
Code - Insiders.exe!blink::AXObject::UpdateCachedAttributeValuesIfNeeded
Code - Insiders.exe!blink::AXObject::AccessibilityIsIgnored
Code - Insiders.exe!blink::AXObjectCacheImpl::FireAXEventImmediately
Code - Insiders.exe!blink::AXNodeObject::ChildrenChanged
Code - Insiders.exe!blink::AXObjectCacheImpl::ChildrenChanged
Code - Insiders.exe!blink::AXObjectCacheImpl::FireTreeUpdatedEventImmediately
Code - Insiders.exe!blink::AXObjectCacheImpl::ProcessUpdates
Code - Insiders.exe!blink::AXObjectCacheImpl::ProcessDeferredAccessibilityEvents
Code - Insiders.exe!blink::LocalFrameView::ForAllNonThrottledLocalFrameViews<`lambda at ../../third_party/blink/renderer/core/frame/local_frame_view.cc:2664:37'>
Code - Insiders.exe!blink::LocalFrameView::RunAccessibilityLifecyclePhase
Code - Insiders.exe!blink::LocalFrameView::UpdateLifecyclePhasesInternal
Code - Insiders.exe!blink::LocalFrameView::UpdateLifecyclePhases
Code - Insiders.exe!blink::PageAnimator::UpdateAllLifecyclePhases
Code - Insiders.exe!blink::WebViewImpl::UpdateLifecycle
Code - Insiders.exe!blink::WidgetBase::UpdateVisualState
Code - Insiders.exe!cc::LayerTreeHost::RequestMainFrameUpdate
Code - Insiders.exe!cc::ProxyMain::BeginMainFrame
Code - Insiders.exe!base::internal::Invoker<base::internal::BindState<void (cc::ProxyMain::*)(std::__1::unique_ptr<cc::BeginMainFrameAndCommitState,std::__1::default_delete<cc::BeginMainFrameAndCommitState>>),base::WeakPtr<cc::ProxyMain>,std::__1::unique_ptr<cc::BeginMainFrameAndCommitState,std::__1::default_delete<cc::BeginMainFrameAndCommitState>>>,void ()>::RunOnce
Code - Insiders.exe!base::TaskAnnotator::RunTask
Code - Insiders.exe!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWorkImpl
Code - Insiders.exe!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::DoWork
Code - Insiders.exe!base::MessagePumpDefault::Run
Code - Insiders.exe!base::sequence_manager::internal::ThreadControllerWithMessagePumpImpl::Run
Code - Insiders.exe!base::RunLoop::Run
Code - Insiders.exe!content::RendererMain
Code - Insiders.exe!content::ContentMainRunnerImpl::Run
Code - Insiders.exe!service_manager::Main
Code - Insiders.exe!content::ContentMain
Code - Insiders.exe!wWinMain
Code - Insiders.exe!__scrt_common_main_seh
kernel32.dll!?
ntdll.dll!?
[Root]

I was not able to find the same stack in a trace from my local dev box, the AXObject is something that gets constructed for accessibility tree in the renderer, this gave a clue as to maybe the problem happens when accessibility is involved. Turning on the screen reader and performing the scroll did create the same stack along with a visible slowdown.

This brings me to my question, is everyone here seeing the issue had screen reader enabled ?

I do not use the screen reader

@RLesma
Copy link
Author

@RLesma RLesma commented Sep 23, 2020

image

This shows that the narrator is not enabled, I think

@Perh0rd
Copy link

@Perh0rd Perh0rd commented Sep 23, 2020

Just to add, I do not have a touchscreen neither

@deepak1556
Copy link
Contributor

@deepak1556 deepak1556 commented Sep 23, 2020

Thanks @alexdima for the additional context,

I also remember that Electron had some custom code here on top of Chromium so maybe that one no longer works correctly?

https://github.com/electron/electron/blob/master/shell/browser/native_window_views_win.cc#L196-L225

Considering users facing the issue don't have narrator enabled, definitely a bug in either electron/chromium entering accessible mode by default.

why is Chromium so slow when it enables accessibility mode -- that should not be the case

Don't have a definitive answer for this, workaround given by chromium authors to prevent this particular stack was to add a non-transparent background color. We might want to check on this perf issue with newer versions of chromium. I am currently building a exploration release based on Chromium 87.

@deepak1556
Copy link
Contributor

@deepak1556 deepak1556 commented Sep 23, 2020

Here is exploration build based on chromium 87 https://az764295.vo.msecnd.net/exploration/53c0ab95bb770a8f3f869e81bb9da200708e6700/VSCodeUserSetup-x64-1.50.0-exploration.exe , can you check if the slowdown is still visible. Thanks!

One more question to users facing the issue, are you running windows on some VM ?

@deepak1556
Copy link
Contributor

@deepak1556 deepak1556 commented Sep 23, 2020

Apart from testing the exploration builds, can you also check if launching code --disable-renderer-accessibility fixes the issue.

@Minkyu-Choi
Copy link

@Minkyu-Choi Minkyu-Choi commented Sep 24, 2020

@deepak1556 code-insider with --disable-rendere-accessibility options shows much better scrolls both keyboard and wheel than before!
Also, exploration build scrolls better than before but not better than disable-renderer-accessibility option.
Finally, I'm not running windows on VM. It seems like disable-renderer-accessibility option is best workaround now.

@deepak1556 deepak1556 added this to the December/January 2021 milestone Dec 2, 2020
@perholmes
Copy link

@perholmes perholmes commented Dec 6, 2020

Also confirming that with --disable-renderer-accessibility, scrolling frame rate when from 1-10 FPS up to 60 FPS.

@CosmicBagel
Copy link

@CosmicBagel CosmicBagel commented Dec 8, 2020

I've been going crazy the last few days trying to figure out why the editor is so dang slow and finally found this, it's smooth again! (Even tried with all extensions disabled)
launching with --disable-renderer-accessibility massively improves the performance

VS Code version: 1.51.1
Windows 10 20H2 (19042.630)

@dylanwulf
Copy link

@dylanwulf dylanwulf commented Dec 10, 2020

I believe I've found a reliable way to reproduce this issue (on my computer at least):

  • Open VSCode
  • Open Spotify (the Windows store app)
  • Start playing music in Spotify
  • Minimize Spotify and focus back on VSCode
  • Press the "pause" media key on my keyboard to pause Spotify while it is minimized
  • VSCode scrolling is now quite laggy
  • Restarting VSCode or Spotify does not fix the issue. Restarting Windows does fix the issue, until I repeat the above steps.

Others who have reported this issue, please confirm the following

  • Does running with --disable-renderer-accessibility help improve the perf ?
  • What is the output of running #107016 (comment)
  • Is the exploration build #107016 (comment) any better in perf ?
  • Yes, --disable-renderer-accessibility makes it significantly better
  • 0
  • Yes

Other Info about my computer:

  • VSCode version: 1.51.1
  • Windows version: Windows 10 Pro version 20H2 build 19042.685
  • Touchscreen: Yes
  • Windows running in a VM: No
  • Computer supports tablet mode: Yes
  • Computer was in tablet mode at the time the issue occurred: No
  • Logitech Options application installed: Yes
@m-crabtree
Copy link

@m-crabtree m-crabtree commented Dec 11, 2020

updating to 1.52.0 appears to have resolved the issue on my end. i can now launch vscode from the start menu, from the terminal, and from an AHK script, all without using --disable-renderer-accessibility, and scrolling through thousands of lines feels just fine.

update: after almost a week of code working just fine it's gone back to stuttering when scrolling through large files. --disable-renderer-accessibility resolves the issue.

@perholmes
Copy link

@perholmes perholmes commented Dec 11, 2020

1.52.0 does NOT resolve the problem here. Removing --disable-renderer-accessibility, I'm back to a solid 5-10 fps.

@dylanwulf
Copy link

@dylanwulf dylanwulf commented Dec 11, 2020

Strangely, installing the update to 1.52.0 temporarily fixed the issue, but as soon as I go through the reproduction steps in #107016 (comment) or #107016 (comment) the issue returns. --disable-renderer-accessibility still appears to work as a workaround.

@motss
Copy link

@motss motss commented Dec 12, 2020

I've been struggling with the performance issue recently on Windows 10 x64.

code --disable-renderer-accessibility . works for me. Scrolling and typing is now back to buttery smooth without disabling any running extensions.

I got this error message though after applying the flag:

[1213/005014.191:ERROR:registration_protocol_win.cc(103)] CreateFile: The system cannot find the file specified. (0x2)
Warning: 'disable-renderer-accessibility' is not in the list of known options, but still passed to Electron/Chromium.

Really hoping that this can be resolved without this flag on Windows.

@markeissler
Copy link

@markeissler markeissler commented Dec 17, 2020

The use of --disable-renderer-accessibility doesn't appear to work if launching this from within Ubuntu (for example) running in WSL2. I get this:

$ code --disable-renderer-accessibility .
Ignoring option disable-renderer-accessibility: not supported for code.

VSCode launches but is still super slow. I'm also on v1.52.1.

@SeanChao
Copy link

@SeanChao SeanChao commented Dec 18, 2020

The use of --disable-renderer-accessibility doesn't appear to work if launching this from within Ubuntu (for example) running in WSL2. I get this:

$ code --disable-renderer-accessibility .
Ignoring option disable-renderer-accessibility: not supported for code.

VSCode launches but is still super slow. I'm also on v1.52.1.

You can launch VSCode from Windows and then open a WSL project, it works

@mabasic
Copy link

@mabasic mabasic commented Dec 19, 2020

I was almost going to switch to a different IDE and/or reinstall OS xD before finding out this issue..

Update: Adding --disable-renderer-accessibility, then starting vs code from Windows, then navigating to WSL2 directory. VS code seems to work a bit faster, but it still lags on scroll and sidebar toggle...

@EgoistDeveloper
Copy link

@EgoistDeveloper EgoistDeveloper commented Dec 21, 2020

--disable-renderer-accessibility not effected any thing. I tried every setting and combination but it is not working stable.

I removed Logitech Options app then restarted system. Hardware and native OS pointer/wheel sensitivity working perfectly. It is not solution but enough for until fix this. I think problem is not about compeletly electron or chromium. Options app Highly depends to logitech and OS. I will waiting next updates.

@azmiadhani
Copy link

@azmiadhani azmiadhani commented Dec 22, 2020

--disable-renderer-accessibility did make fps when scrolling become 10-30 fps, without code --disable-renderer-accessibility fps is around 0-5 fps

@mzandvliet
Copy link

@mzandvliet mzandvliet commented Dec 23, 2020

Just another confirmation that on vscode 1.52.1 launching with --disable-renderer-accessibility fixes dramatic slowdown for me.

@schroef
Copy link

@schroef schroef commented Dec 31, 2020

Hi all - just want to confirm on Windows 10 (v1809) that running vscode with --disable-renderer-accessibility has dramatically increased scroll performance for me especially on larger files.

where do we need to add this line?

okay so i add this in the shortcut properties > target. I dont feel there is any difference. Touchpad laptop is super smooth, wacom tablet feel laggy, like it has low FPS. Same as when i use the scroll wheel on there

@seanmortimer
Copy link

@seanmortimer seanmortimer commented Jan 4, 2021

code --disable-renderer-accessibility
Gives me:

Warning: 'disable-renderer-accessibility' is not in the list of known options, but still passed to Electron/Chromium.

What am I doing wrong?

@dylanwulf
Copy link

@dylanwulf dylanwulf commented Jan 4, 2021

@seanmortimer

What am I doing wrong?

Nothing, mine does that too. Even with the warning it still seems to work for me.

@gencer
Copy link

@gencer gencer commented Jan 4, 2021

code --disable-renderer-accessibility
Gives me:

Warning: 'disable-renderer-accessibility' is not in the list of known options, but still passed to Electron/Chromium.

What am I doing wrong?

You're not doing anything wrong. It ain't supported. But it will by subprocess. Just ignore it.

@azmiadhani
Copy link

@azmiadhani azmiadhani commented Jan 4, 2021

Hi all - just want to confirm on Windows 10 (v1809) that running vscode with --disable-renderer-accessibility has dramatically increased scroll performance for me especially on larger files.

where do we need to add this line?

okay so i add this in the shortcut properties > target. I dont feel there is any difference. Touchpad laptop is super smooth, wacom tablet feel laggy, like it has low FPS. Same as when i use the scroll wheel on there

Add it on shortcut after .exe or you can simply type in cmd code --disable-renderer-accessibility

@seanmortimer
Copy link

@seanmortimer seanmortimer commented Jan 4, 2021

@dylanwulf, @gencer
Thank you. Indeed, running code --disable-renderer-accessibility from powershell totally fixes the scroll lag for me.
Interestingly, the same command from the Ubuntu command line in WSL doesn't fix it.

@alexdima
Copy link
Member

@alexdima alexdima commented Jan 5, 2021

@deepak1556 Is there anything we could do on our side, like detect this case somehow and proactively inform users that the renderer has entered accessibiliy mode or something like that??

@djmisterjon
Copy link

@djmisterjon djmisterjon commented Jan 6, 2021

Never open MicrosoftVirtualKeyboard in your current Window sessions. 😂
here proof in video with vscode huge file.
https://youtu.be/14AKtLqlbtE
Thas mean check all background software in your machine, they can break vscode.
like:
*Mouses macro softwares, (Logitech options on my side is fine)
*Keyboards macro softwares. (Redragon K580RGB Keyboard for me is fines)

the irony is the offending keyboard software is developed by Microsoft. the other one not break Vscode !
so this mean even on a fresh install OS, Windows could have native processes or app that will break Microsoft Vscode!


--- EDIT
i just want add a hint, i also dev with nwjs based on chromium like electron, and since i get sometime weird ghost laggy memory leak app.
When this happened vscode was very laggy (lethargy state).
https://youtu.be/NNVjv-cPzvk
It could be that this is also related to chromium and the problem is related to the use of external accessibility softwares or process.
Its can cause serious damages to an SSD and Ram
image
I guess when vscode goes into this lethargy state to link an outside program accessibility from chromium, it doesn't handle or break the debugging system or command well and keeps sometime children app alive ! and those need to be kill manually!

@dvdvnl
Copy link

@dvdvnl dvdvnl commented Jan 7, 2021

Any plans on adding --disable-renderer-accessibility to the argv.json file? --disable-gpu does nothing for me.

Is this something you'd consider implementing @alexdima - if I may respond to your latest comment on this issue?

I'd find this very useful as I assume this would set the argument everytime VSCode is opened, no matter how. Personally, I constantly use the "Open with Code" option in the Windows Explorer context menu.

@rzhao271
Copy link
Contributor

@rzhao271 rzhao271 commented Jan 7, 2021

There is a setting editor.accessibilitySupport within VS Code and it can be switched to off. I wonder if that works instead of having to pass in --disable-renderer-accessibility every time?

@alexdima
Copy link
Member

@alexdima alexdima commented Jan 7, 2021

@rzhao271 No, editor.accessibilitySupport does not have any effect on Electron.

@lesmo
Copy link

@lesmo lesmo commented Jan 17, 2021

I've also seen that running code with --disable-renderer-accessibility makes Code scrolling work smoother. I've also assigned my GPU to render VSCode, but I'm not sure if that's actually helping or it's just placebo.

I've got a tiny suggestion for everyone else trying to use Code with the aforementioned flag all the time:

How to edit Code CLI arguments globally

Yu can just edit your code/code.cmd files to make VSCode always run with --disable-renderer-accessibility flag when running it from CLI (which I do a lot).

On Windows you can find these files in C:\Users\<user>\AppData\Local\Programs\Microsoft VS Code\bin and edit them like so:

# File: code (used by WSL)
@@ -58,5 +58,5 @@ elif [ -x "$(command -v cygpath)" ]; then
 else
        CLI="$VSCODE_PATH/resources/app/out/cli.js"
 fi
-ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" "$@"
+ELECTRON_RUN_AS_NODE=1 "$ELECTRON" "$CLI" --disable-renderer-accessibility "$@"
# File: code.cmd (used by Windows)
@@ -2,5 +2,5 @@
 setlocal
 set VSCODE_DEV=
 set ELECTRON_RUN_AS_NODE=1
-"%~dp0..\Code.exe" "%~dp0..\resources\app\out\cli.js" %*
+"%~dp0..\Code.exe" "%~dp0..\resources\app\out\cli.js" --disable-renderer-accessibility %*

The Start Menu shortcut does NOT use above files, they directly run "Code.exe" so you'll want to edit that one too.

I'm not sure if this edits will survive updates.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.