Skip to content

[Spec] UI Delay during ISettings initialization

Kartheek Penagamuri edited this page Nov 21, 2019 · 7 revisions

UI Delay during ISettings initialization

Issue

8675 - UI delay while initializing NuGet.Configuration.ISettings type

Problem Background

VS IDE customers are experiencing UI Delays when NuGet tries to initialize NuGet.Configuration.ISettings (Lazy type) in constructor of VsPackageSourceProvider type on the main UI thread.

Who are the customers

All VS IDE customers

Solution

Andrew Arnott mentioned following important points in an offline conversation.

  • MEF parts are not supposed to have any thread affinity, so moving the realization of exports (all the disk I/O from assembly loads, JIT time) and other non-UI code to a background thread could dramatically reduce the UI delay.
  • Moving the heavyweight code that’s in the MEF activation path out of that path and into other methods that can be made asynchronous.

Short-Term solution

  • As per this remark, it is not required to invoke IVsPackageSourceProvider API on UI thread. Modify Roslyn implementation to call NuGet API on a background thread. NuGet can switch to main thread within the context of JTF as and when required.

Long-Term solution

  • WIP

Current references

Implementation

Contributing

What's Being Worked On?

Check out the proposals in the accepted & proposed folders on the repository, and active PRs for proposals being discussed today.

Common Problems

Clone this wiki locally