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

Use ActivatorUtilities.CreateFactory instead of CreateInstance #1570

Closed
BrennanConroy opened this issue Mar 9, 2018 · 1 comment
Closed
Assignees
Labels
3 - Done area: Performance cost: S Will take up to 2 days to complete

Comments

@BrennanConroy
Copy link
Member

@pakrym made me aware of the CreateFactory method which should be faster that CreateInstance especially when creating instances many times (hub creation per invocation). And of course we can cache the factory method.

hub = ActivatorUtilities.CreateInstance<THub>(_serviceProvider);

@analogrelay analogrelay added this to the 2.1.0-preview2 milestone Mar 9, 2018
@analogrelay analogrelay added the cost: S Will take up to 2 days to complete label Mar 16, 2018
@davidfowl davidfowl assigned davidfowl and unassigned mikaelm12 Mar 19, 2018
@davidfowl
Copy link
Member

I'm stealing this one @mikaelm12

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
3 - Done area: Performance cost: S Will take up to 2 days to complete
Projects
None yet
Development

No branches or pull requests

4 participants