Skip to content

Don't load parts early from MEF that aren't needed#62090

Merged
jasonmalinowski merged 4 commits intodotnet:mainfrom
jasonmalinowski:do-not-eagerly-load-things-for-object-browser
Jun 27, 2022
Merged

Don't load parts early from MEF that aren't needed#62090
jasonmalinowski merged 4 commits intodotnet:mainfrom
jasonmalinowski:do-not-eagerly-load-things-for-object-browser

Conversation

@jasonmalinowski
Copy link
Copy Markdown
Member

When our package loads, we register our library objects which is what drives class view and object browser. The constructor for this proactively loads a few services which are then only used if you invoked go to definition or find references through the object browser. It's a tiny cost (25ms) in one trace but each little bit counts when trying to make load times better.

When our package loads, we register our library objects which is what
drives class view and object browser. The constructor for this
proactively loads a few services which are then only used if you
invoked go to definition or find references through the object browser.
It's a tiny cost (25ms) in one trace but each little bit counts when
trying to make load times better.
@jasonmalinowski jasonmalinowski requested a review from a team as a code owner June 22, 2022 23:24
@jasonmalinowski jasonmalinowski self-assigned this Jun 22, 2022
@ghost ghost added the Area-IDE label Jun 22, 2022
@jasonmalinowski
Copy link
Copy Markdown
Member Author

@sharwell: updated some of the places to avoid the fire-and-forgets that this PR was touching. I wouldn't be surprised if there's plenty more badness in this area of the codebase, but I don't want to hold up the original intent of this PR trying to fix unrelated things.


// Fire and forget
_ = GoToSourceAsync(index, srcType);
var asynchronousOperationListener = LibraryManager.ComponentModel.GetService<IAsynchronousOperationListenerProvider>().GetListener(FeatureAttribute.LibraryManager);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

💡 Can we make this a property of LibraryManager?

Copy link
Copy Markdown
Contributor

@sharwell sharwell left a comment

Choose a reason for hiding this comment

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

Would like to see the listener refactored for easy re-use in the component, but now looks good.

@jasonmalinowski jasonmalinowski merged commit f0f0a4e into dotnet:main Jun 27, 2022
@jasonmalinowski jasonmalinowski deleted the do-not-eagerly-load-things-for-object-browser branch June 27, 2022 22:06
@ghost ghost added this to the Next milestone Jun 27, 2022
@RikkiGibson RikkiGibson modified the milestones: Next, 17.3 P3 Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants