Skip to content
This repository was archived by the owner on Jun 5, 2025. It is now read-only.

Conversation

@sshilov7
Copy link
Member

@sshilov7 sshilov7 commented May 8, 2024

Summary of the pull request

Loading and displaying Hyper-V VMs data on Landing and SetupTarget pages has a visible delay that is caused by several factors:

  1. First time interacting with Hyper-V VMs loads PowerShell runtime. This can cause significant delay, depending on the user's configuration. On my machine automatic loading of IxpTools add ~8 seconds.
  2. Getting data from DevHome Hyper-V extension can be expensive due to OOP calls.
  3. We fetch Compute System data sequentially on UI thread.

This PR:
Improves 1. by removing explicit "Is Hyper-V module loaded" checks that we don't need. To make more improvements in that area we will likely need to move away from PowerShell and use WMI.
Removes OOP calls from UI thread by fetching and caching Compute Systems data in parallel on thread pool before making model initialization call on UI thread.

Video before the change:
https://github.com/microsoft/devhome/assets/51001703/51fe0672-4b36-4674-82e9-2d47a4df2604

Video after the change:
https://github.com/microsoft/devhome/assets/51001703/b77b4602-6597-46aa-9c50-1441bad8914a

References and relevant issues

Enumerating the hyper-V VMs takes longer than the experience in Hyper-V Manager

Detailed description of the pull request / Additional comments

Added ComputeSystemPropertyCache and ComputeSystemCache classes for caching VMs data via lazy initialization. Once we replace usage of ComputeSystem class with ComputeSystemCache we can merge those classes.

PR checklist

@sshilov7 sshilov7 self-assigned this May 8, 2024
Copy link
Contributor

@huzaifa-d huzaifa-d left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did you have a chance to test these changes with the Azure extension/Dev Box as well?

@sshilov7 sshilov7 merged commit e190cdd into main May 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enumerating the hyper-V VMs takes longer than the experience in Hyper-V Manager

4 participants