Currently, MS.DI when creating a scope calls the Resolve/GetRequiredService for the IServiceScopeFactory.
The IServiceScopeFactory is implemented by DryIocServiceProviderCapabilities which object is created in DryIoc MS.DI adapter and the stored in singleton scope via Use method. There are 3 entries in Used collection storing all the capabilities also including IServiceProviderIsService and ISupportRequiredService (the latter is the subject for the other issue #TBD).
As the Used objects are general purpose and given that the used collection is not empty now, means that every Resolution and Injection will examine and waste some time to check the Used objects.
TBD the details of why Use is slow on the hot path
Currently, MS.DI when creating a scope calls the
Resolve
/GetRequiredService
for theIServiceScopeFactory
.The
IServiceScopeFactory
is implemented byDryIocServiceProviderCapabilities
which object is created in DryIoc MS.DI adapter and the stored in singleton scope viaUse
method. There are 3 entries in Used collection storing all the capabilities also includingIServiceProviderIsService
andISupportRequiredService
(the latter is the subject for the other issue #TBD).As the Used objects are general purpose and given that the used collection is not empty now, means that every Resolution and Injection will examine and waste some time to check the Used objects.
TBD the details of why Use is slow on the hot path