-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Regression in Microsoft.Extensions.DependencyInjection.TimeToFirstService #57146
Comments
Tagging subscribers to this area: @eerhardt, @maryamariyan Issue DetailsRun Information
Regressions in Microsoft.Extensions.DependencyInjection.TimeToFirstService
Reprogit clone https://github.com/dotnet/performance.git
py .\performance\scripts\benchmarks_ci.py -f netcoreapp5.0 --filter 'Microsoft.Extensions.DependencyInjection.TimeToFirstService*' PayloadsHistogramMicrosoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "Runtime")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "Runtime")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "Runtime")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "Runtime")
DocsProfiling workflow for dotnet/runtime repository
|
The majority of the regression here occurred because we depend on the ServiceProvider being disposed in order to remove it from the list maintained in the EventSource. See #56809 for more details. However, the perf test isn't disposing of all the ServiceProviders it creates. I'm fixing that in dotnet/performance#1915. However, even with that fixed, we still have a ~5-10% regression here. After profiling, I see that creating
@davidfowl - do you think using WeakReference is an acceptable tradeoff here? Or should we instead remove the WeakReference usage? My initial thoughts are that typical apps don't create many ServiceProviders, so using WeakReference is acceptable here. |
…#1915) * Fix TimeToFirstService tests to dispose the ServiceProvider correctly Contributes to dotnet/runtime#57146 * Move Dispose into the Benchmarck, as IterationCleanup shouldn't be used in a micro benchmark.
Consulting with @davidfowl offline, we both agree that we should keep the WeakReference as it is currently in the code. Thus the regression noted in my comment above is acceptable. The major regression part of the test was addressed with dotnet/performance#1915 (disposing the ServiceProviders properly). Closing. |
Run Information
Regressions in Microsoft.Extensions.DependencyInjection.TimeToFirstService
Historical Data in Reporting System
Repro
Payloads
Baseline
Compare
Histogram
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "ILEmit")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "Runtime")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Transient(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "Dynamic")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "Runtime")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Singleton(Mode: "Expressions")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.Scoped(Mode: "Runtime")
Microsoft.Extensions.DependencyInjection.TimeToFirstService.BuildProvider(Mode: "Runtime")
Docs
Profiling workflow for dotnet/runtime repository
Benchmarking workflow for dotnet/runtime repository
The text was updated successfully, but these errors were encountered: