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

Use Factory methods in DependencyInjection #5290

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

eerhardt
Copy link
Member

Using factory methods and directly invoking the constructors instead of letting DI use reflection to find the constructor.

In local testing this appeared to shave off ~7ms from startup of a dotnet new maui app.

With changes:
Average(ms): 571
Average(ms): 579.9
Average(ms): 572.6

Main:
Average(ms): 584.5
Average(ms): 586.9
Average(ms): 579.6

Using factory methods and directly invoking the constructors instead of letting DI use reflection to find the constructor.

In local testing this appeared to shave off ~7ms from startup of a dotnet new maui app.
- Add TryAddSingleton`2 to the banned API list
@PureWeen PureWeen merged commit e7812b0 into dotnet:main Mar 15, 2022
@eerhardt eerhardt deleted the UseConstructorsDirectly branch March 18, 2022 19:33
@samhouts samhouts added area-architecture Issues with code structure, SDK structure, implementation details legacy-area-perf Startup / Runtime performance and removed area-architecture Issues with code structure, SDK structure, implementation details labels Jul 20, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 22, 2023
@Eilon Eilon added the t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf) label May 10, 2024
@samhouts samhouts added the fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! label Aug 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
fixed-in-6.0.300-rc.1 Look for this fix in 6.0.300-rc.1! legacy-area-perf Startup / Runtime performance t/perf The issue affects performance (runtime speed, memory usage, startup time, etc.) (sub: perf)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants