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

Cache the DTE instance in VSSolution Manager, prefer using IVsSolution to retrieve solution file, solution directory and solution open information #4693

Merged
merged 2 commits into from
Jun 21, 2022

Conversation

nkolev92
Copy link
Member

@nkolev92 nkolev92 commented Jun 21, 2022

Bug

Fixes: NuGet/Home#11902

Regression? Last working version:

Description

The DTE service is used quite frequently during the solution initialization (about once per project usually).
This service doesn't change and as such it can be cached. This is another part of https://github.com/NuGet/Client.Engineering/issues/1374

This retrieval accounts for 8% of the initialization of a test lab solution.

In addition to caching the DTE service, we'll use IVsSolution over DTE service where appropriate (there's a bunch of usages of DTE remaining. They'll be handled in a future PR).

Note that while we do have a field for the IVsSolution, there's no guarantee that InitializeAsync of VSSolutionManager has run by the time the methods that were changed were called, so I just switched it to an async lazy to avoid race conditions.

PR Checklist

  • PR has a meaningful title

  • PR has a linked issue.

  • Described changes

  • Tests

    • Automated tests added
    • OR
    • Test exception - These scenarios are included in E2E/manual tests.
    • OR
    • N/A
  • Documentation

    • Documentation PR or issue filled
    • OR
    • N/A

@nkolev92 nkolev92 requested a review from a team as a code owner June 21, 2022 01:12
@nkolev92 nkolev92 changed the title Cache the DTE instance in VSSolution Manager Cache the DTE instance in VSSolution Manager, prefer using IVsSolution to retrieve solution file, solution directory and solution open information Jun 21, 2022
@nkolev92
Copy link
Member Author

cc @davkean

Hoping you can take a look at this.

After this, I'll work on changing GetAllEnvDTEProjectsAsync to use IVsSolution instead of the DTE.

@nkolev92 nkolev92 merged commit 65fcc7d into dev Jun 21, 2022
@nkolev92 nkolev92 deleted the dev-nkolev92-cacheDTEInVSSolutionManager branch June 21, 2022 17:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache DTE service in VS Solution Manager
4 participants