This PR is to address further issues showing in performance traces.
Due to the code is in the hot path to load solution, some further works:
1, first export was added twice in the list, which might be the reason of complex LINQ code later. This PR fixes the issue, but I keep the original LINQ code just to prevent changing behaviors.
2, Use MEF metadata instead of reflection APIs. MEF can cache strings efficiently, while reflection is slow, and also the code would load components then checking the capabilities, which is incorrect.
3, prevent using LINQ in this hot path, i updated it to a normal loop.
This PR is to address further issues showing in performance traces.
Due to the code is in the hot path to load solution, some further works:
1, first export was added twice in the list, which might be the reason of complex LINQ code later. This PR fixes the issue, but I keep the original LINQ code just to prevent changing behaviors.
2, Use MEF metadata instead of reflection APIs. MEF can cache strings efficiently, while reflection is slow, and also the code would load components then checking the capabilities, which is incorrect.
3, prevent using LINQ in this hot path, i updated it to a normal loop.
Microsoft Reviewers: Open in CodeFlow