Replies: 1 comment
-
Hi, @appel1 I have tried your benchmark and got similar results: BenchmarkDotNet v0.13.11, Windows 11 (10.0.22631.3672/23H2/2023Update/SunValley3)
Intel Core i9-8950HK CPU 2.90GHz (Coffee Lake), 1 CPU, 12 logical and 6 physical cores
.NET SDK 8.0.204
[Host] : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2
.NET 8.0 : .NET 8.0.4 (8.0.424.16909), X64 RyuJIT AVX2
Job=.NET 8.0 Runtime=.NET 8.0
| Method | type | Mean | Error | StdDev | Gen0 | Allocated |
|------------------------------------- |--------- |------------:|----------:|-----------:|-------:|----------:|
| DryIoc_WithConcreteTypeRegistrations | INoDep | 24.97 ns | 0.644 ns | 1.889 ns | 0.0038 | 24 B |
| DryIoc_WithConcreteTypeRegistrations | ICtorDep | 29.35 ns | 0.862 ns | 2.542 ns | 0.0076 | 48 B |
| DryIoc_WithConcreteTypeRegistrations | NoDep | 983.30 ns | 28.969 ns | 85.416 ns | 0.1144 | 728 B |
| DryIoc_WithConcreteTypeRegistrations | CtorDep | 2,024.36 ns | 54.419 ns | 160.457 ns | 0.2060 | 1296 B | Sure, the results are slower, because the automatic concrete types resolution is far from the happy path. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I'm looking into switching to DryIoc and it looks like performance resolving a concrete type that hasn't been registered using WithConcreteTypeDynamicRegistrations is quite a bit slower that resolving a registered service. It's very possible I've done something stupid in my benchmark? Is there a better way to not have to register everything?
Beta Was this translation helpful? Give feedback.
All reactions