Skip to content
This repository has been archived by the owner on Dec 14, 2018. It is now read-only.

Avoid redundant Assembly.Load call in DefaultAssemblyPartDiscoveryProvider #6003

Closed
CoskunSunali opened this issue Mar 22, 2017 · 8 comments
Closed
Assignees

Comments

@CoskunSunali
Copy link
Contributor

I don't know if I am overlooking but if I am right, the assemblies are being loaded twice during the discovery of assembly parts.

Please see: https://github.com/aspnet/Mvc/blob/dev/src/Microsoft.AspNetCore.Mvc.Core/Internal/DefaultAssemblyPartDiscoveryProvider.cs#L37-L38

@pranavkm
Copy link
Contributor

Yup, would you like to send a PR to fix it?

@CoskunSunali
Copy link
Contributor Author

Sure, will do that asap.

@CoskunSunali
Copy link
Contributor Author

Created the PR. This was my first-ever contribution. Please kindly let me know if I was able to follow the contribution/PR guidelines correctly.

@Eilon
Copy link
Member

Eilon commented Mar 23, 2017

BTW I doubt the assembly is actually loaded twice because I'd think everything is cached by the CLR. But still, good to clean this up!

@davidfowl
Copy link
Member

Yep it is cached

@CoskunSunali
Copy link
Contributor Author

If it is being cached (thankfully!) the title of the issue might be misleading, as well as the PR's title. Is it a good idea to change it?

@pranavkm pranavkm changed the title Assemblies being loaded twice during AssemblyPart discovery Avoid redundant Assembly.Load call in DefaultAssemblyPartDiscoveryProvider Mar 23, 2017
@pranavkm
Copy link
Contributor

It's still good to re-use the variable like you did. I tweaked the title a bit to reflect this. Thanks for the PR, your change was merged in d2430f0

@CoskunSunali
Copy link
Contributor Author

@pranavkm Thank you for the update!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants