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

[Feature Request] Lazy Loading #163

Closed
Sewer56 opened this issue Oct 11, 2020 · 1 comment · Fixed by #164
Closed

[Feature Request] Lazy Loading #163

Sewer56 opened this issue Oct 11, 2020 · 1 comment · Fixed by #164
Labels
enhancement New feature or request help wanted Extra attention is needed

Comments

@Sewer56
Copy link
Contributor

Sewer56 commented Oct 11, 2020

Is your feature request related to a problem? Please describe.
Loading a plugin where you only need to extract a small amount of data, such as metadata about the author of the plugin before properly loading it is expensive.

When building an AssemblyLoadContext, the library attempts to resolve and pre-load dependencies of all shared types as calls to AssemblyLoadContextBuilder.PreferDefaultLoadContextAssembly are performed. This incurs a considerable I/O bottleneck.

This bottleneck becomes very clear when for example, the user clicks the plugin in a UI application and the plugin needs to be loaded to see if configuration of the plugin is possible. (A developer might implement configuring plugins using a PropertyGrid on an object returned from the plugin).

The other case is simple.
Not all loaded assemblies might be used in practice, some of the loaded assemblies may never be needed.

Describe the solution you'd like
Lazy loading of dependencies of shared assemblies.
Only load additional assemblies as they are needed.

Describe alternatives you've considered
N/A.

This is strictly a performance measure aimed at improving startup times.

Pull Request
Please see #164

Additional context
This is a copy of my earlier PR #158 , I wanted to rename the branch and am splitting this into an issue and PR as it always should have been.

@Sewer56 Sewer56 added the enhancement New feature or request label Oct 11, 2020
@natemcmaster natemcmaster added the help wanted Extra attention is needed label Dec 27, 2020
@natemcmaster
Copy link
Owner

Marking has help-wanted. Not something I would implement on my own, but I see a proposal #164 has already been made.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants