SingletonPerScope
This benchmark registers a small object as Singleton Per Scope then creates a scope and resolves the small object. The code can be found here.
Container | Env | Mean (ns) | Median (ns) | Max (ns) | Outliers | Std Dev (ns) | Std Err (ns) | Gen 1 | Gen 2 | Bytes Alloc |
---|---|---|---|---|---|---|---|---|---|---|
Autofac | Clr | 3155.1 | 3155.3 | 3156.9 | 0 | 1.023 | 0.264 | 0 | 0 | 3768 |
Castle Windsor | Clr | 15180.2 | 15178.7 | 15194.7 | 0 | 11.763 | 3.396 | 0 | 0 | 3944 |
DryIoc | Clr | 289.4 | 289.4 | 289.7 | 0 | 0.173 | 0.048 | 0 | 0 | 696 |
Grace | Clr | 196.0 | 196.0 | 196.0 | 0 | 0.016 | 0.005 | 0 | 0 | 376 |
LightInject | Clr | 702.4 | 702.4 | 702.9 | 1 | 0.166 | 0.046 | 0 | 0 | 752 |
Microsoft Dependency Injection | Clr | 518.9 | 518.9 | 519.0 | 0 | 0.070 | 0.018 | 0 | 0 | 432 |
StructureMap | Clr | 21897.3 | 21894.0 | 21992.2 | 0 | 43.382 | 11.201 | 99 | 0 | 14459 |
Autofac | Core | 3929.8 | 3930.0 | 3931.8 | 0 | 1.516 | 0.405 | 0 | 0 | 3768 |
Castle Windsor | Core | 23673.5 | 23675.7 | 23740.4 | 0 | 32.478 | 8.386 | 0 | 0 | 5592 |
DryIoc | Core | 1949.4 | 1951.1 | 1959.8 | 0 | 6.249 | 1.613 | 0 | 0 | 648 |
Grace | Core | 218.6 | 218.6 | 218.7 | 0 | 0.029 | 0.008 | 0 | 0 | 376 |
LightInject | Core | 848.4 | 848.4 | 848.8 | 0 | 0.185 | 0.048 | 0 | 0 | 752 |
Microsoft Dependency Injection | Core | 611.3 | 611.3 | 611.3 | 0 | 0.043 | 0.011 | 0 | 0 | 432 |
StructureMap | Core | 25222.9 | 25196.7 | 25385.6 | 0 | 67.433 | 18.022 | 90 | 0 | 11707 |
Details
BenchmarkDotNet=v0.10.8, OS=Windows 10 Redstone 2 (10.0.15063)
Processor=Intel Core i7-3770 CPU 3.40GHz (Ivy Bridge), ProcessorCount=4
Frequency=3320336 Hz, Resolution=301.1743 ns, Timer=TSC
[Host] : Clr 4.0.30319.42000, 64bit RyuJIT-v4.7.2101.1
Clr : Clr 4.0.30319.42000, 64bit RyuJIT-v4.7.2101.1
Core : .NET Core 4.6.25211.01, 64bit RyuJIT