Source code of my performance comparison of the most popular .NET IoC containers:
www.palmmedia.de/Blog/2011/8/30/ioc-container-benchmark-performance-comparison
Author: Daniel Palme
Blog: www.palmmedia.de
Twitter: @danielpalme
First value: Time of single-threaded execution in [ms]
Second value: Time of multi-threaded execution in [ms]
*: Benchmark was stopped after 1 minute and result is extrapolated.
Container | Singleton | Transient | Combined | Complex |
---|---|---|---|---|
No | 41 49 |
49 59 |
69 76 |
99 103 |
abioc 0.7.0 | 27 38 |
32 54 |
48 73 |
64 71 |
Autofac 4.9.2 | 549 441 |
963 603 |
2315 1165 |
5779 3431 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.10.0 | 262 317 |
4123 4456 |
9359 10445 |
21780 25331 |
Cauldron.Activator 3.2.3 | 36 51 |
50 64 |
86 103 |
197 152 |
DryIoc 4.0.3 | 33 47 |
45 68 |
63 96 |
76 79 |
DryIocZero 4.0.0 | 110 96 |
88 89 |
98 105 |
220 169 |
Dynamo 3.0.2 | 95 70 |
104 86 |
207 158 |
685 381 |
fFastInjector 1.0.1 | 66 66 |
126 99 |
249 171 |
602 350 |
Funq 1.0.0.0 | 118 90 |
137 110 |
381 251 |
1124 616 |
Grace 6.4.2 | 49 45 |
40 60 |
65 79 |
86 97 |
Griffin 1.1.9 | 300 205 |
318 226 |
719 476 |
2004 1228 |
HaveBox 2.0.0 | 40 48 |
51 62 |
65 88 |
103 95 |
IfInjector 0.8.1 | 75 60 |
128 97 |
145 124 |
197 135 |
Lamar 3.0.1 | 59 61 |
71 80 |
93 125 |
116 131 |
LightCore 1.5.1 | 184 189 |
2191 1301 |
26718 31570 |
151128* 188142* |
LightInject 5.4.0 | 33 45 |
45 67 |
64 89 |
80 100 |
LinFu 2.3.0.41559 | 3167 1709 |
16506 11878 |
45492 29568 |
116514* 76757* |
Maestro 1.5.4 | 356 254 |
1755 2906 |
2437 1743 |
4342 2528 |
Mef 4.0.0.0 | 22679 11820 |
37640 25052 |
57462 68730* |
112712* 131716* |
Mef2 1.0.33.0 | 276 260 |
341 265 |
425 374 |
901 654 |
MicroResolver 2.3.5 | 25 39 |
34 59 |
55 77 |
92 89 |
MicroSliver 2.1.6 | 192 232 |
742 619 |
2394 1786 |
7159 6162 |
Microsoft Extensions DependencyInjection 2.2.0 | 81 69 |
124 107 |
148 143 |
197 159 |
Mugen 3.5.1 | 484 444 |
711 751 |
2285 2494 |
8297 9494 |
Mugen MVVM Toolkit 6.5.0 | 102 138 |
409 715 |
2052 2590 |
9348 11352 |
Munq 3.1.6 | 90 75 |
161 107 |
517 417 |
1812 1050 |
MvvmCross 6.2.3 | 233 291 |
966 1085 |
2655 2975 |
7674 8583 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Rezolver 1.4.0 | 176 138 |
198 161 |
248 207 |
342 245 |
SimpleInjector 4.5.1 | 63 59 |
70 73 |
109 111 |
127 110 |
Singularity 0.9.1-ci0006 | 24 39 |
38 64 |
51 82 |
66 76 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.7.3 | 36 48 |
49 68 |
64 93 |
77 79 |
StructureMap 4.7.1 | 1121 717 |
1281 856 |
3410 2166 |
8312 6052 |
Unity 5.8.6 | 302 281 |
437 405 |
1282 1095 |
3962 3553 |
Windsor 5.0.0 | 437 350 |
1821 1108 |
6402 3712 |
20536 11821 |
Zenject 8.0.0 | 479 448 |
1370 1070 |
3689 3065 |
11142 10106 |
Container | Property | Generics | IEnumerable | Conditional | Child Container | Asp Net Core | Interception With Proxy |
---|---|---|---|---|---|---|---|
No | 186 134 |
70 75 |
193 176 |
53 63 |
644 596 |
469 438 |
|
abioc 0.7.0 | 743 453 |
||||||
Autofac 4.9.2 | 6186 3538 |
2197 1359 |
7840 4498 |
1410 867 |
78796* 47840 |
12609 8039 |
22750 13294 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.10.0 | 9350 10275 |
4087 4533 |
|||||
Cauldron.Activator 3.2.3 | 65 76 |
80 84 |
358 256 |
54 72 |
|||
DryIoc 4.0.3 | 117 116 |
56 81 |
281 205 |
56 69 |
641 484 |
835 556 |
|
DryIocZero 4.0.0 | 294 205 |
92 92 |
302 229 |
380 270 |
|||
Dynamo 3.0.2 | 828 455 |
||||||
fFastInjector 1.0.1 | |||||||
Funq 1.0.0.0 | 1090 639 |
||||||
Grace 6.4.2 | 127 126 |
59 68 |
348 298 |
61 63 |
52454 43244 |
561 528 |
1025 845 |
Griffin 1.1.9 | |||||||
HaveBox 2.0.0 | 741 443 |
1860 1198 |
774 509 |
||||
IfInjector 0.8.1 | 345 227 |
147 120 |
|||||
Lamar 3.0.1 | 71 82 |
89 116 |
527 Error |
595 794 |
|||
LightCore 1.5.1 | 2289 1755 |
15862 14477 |
34754 20480 |
||||
LightInject 5.4.0 | 115 113 |
52 81 |
275 215 |
311 230 |
4654 2822 |
1373 962 |
|
LinFu 2.3.0.41559 | |||||||
Maestro 1.5.4 | 4502 2616 |
2103 2128 |
4443 2483 |
2186 1691 |
7591 4418 |
||
Mef 4.0.0.0 | 124500* 133833* |
137086* 114221* |
97231* 100896* |
||||
Mef2 1.0.33.0 | 1525 1272 |
310 299 |
1554 1273 |
||||
MicroResolver 2.3.5 | 39 62 |
262 195 |
|||||
MicroSliver 2.1.6 | |||||||
Microsoft Extensions DependencyInjection 2.2.0 | 149 130 |
430 303 |
1080 703 |
||||
Mugen 3.5.1 | 10005 8348 |
72189* 72787* |
5619 7027 |
1824 1883 |
550418* 335171* |
13742 16268 |
|
Mugen MVVM Toolkit 6.5.0 | 436 705 |
9749 7094 |
4370 3103 |
||||
Munq 3.1.6 | 1536 847 |
||||||
MvvmCross 6.2.3 | 974 1107 |
6525 8730 |
4645 2945 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Rezolver 1.4.0 | 502 338 |
231 191 |
10945 5286 |
18076000* 11632170* |
27887 16925 |
||
SimpleInjector 4.5.1 | 237 176 |
77 89 |
809 493 |
73 76 |
7231 4253 |
||
Singularity 0.9.1-ci0006 | 48 80 |
289 214 |
1211 833 |
||||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.7.3 | 116 117 |
65 81 |
294 213 |
57 70 |
169556* 100439* |
505 635 |
862 581 |
StructureMap 4.7.1 | 8697 5284 |
2271 1460 |
8399 5170 |
3215578* 1887211* |
42001 26976 |
7859 4464 |
|
Unity 5.8.6 | 4097 3333 |
1396 1210 |
4815 4031 |
1042 861 |
7035 9942 |
16895 18546 |
|
Windsor 5.0.0 | 38096 19775 |
15557 9071 |
17839 10135 |
239286* 140421* |
13662 7695 |
||
Zenject 8.0.0 | 15829 13135 |
9021 6513 |
17932 12687 |
3082 2428 |
22250 18595 |
The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB