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.8.1 | 908 914 |
804 818 |
1917 2140 |
6597 7581 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.6.0 | 272 320 |
4289 4943 |
10216 10914 |
23461 25560 |
Cauldron.Activator 3.0.32 | 41 54 |
52 62 |
95 98 |
176 143 |
DryIoc 3.0.2 | 32 47 |
43 63 |
57 88 |
75 81 |
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.1 | 27 43 |
35 66 |
60 91 |
97 87 |
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 1.1.1 | 62 61 |
93 92 |
110 112 |
137 120 |
LightCore 1.5.1 | 184 189 |
2191 1301 |
26718 31570 |
151128* 188142* |
LightInject 5.1.8 | 25 43 |
34 60 |
52 82 |
70 79 |
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.1.1 | 86 81 |
115 106 |
163 136 |
197 158 |
Mugen 3.5.1 | 484 444 |
711 751 |
2285 2494 |
8297 9494 |
Munq 3.1.6 | 90 75 |
161 107 |
517 417 |
1812 1050 |
MvvmCross 6.1.2 | 233 285 |
962 1011 |
2617 2855 |
7756 8181 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Rezolver 1.3.4 | 177 136 |
202 156 |
265 207 |
409 271 |
SimpleInjector 4.3.0 | 74 77 |
100 90 |
111 109 |
119 126 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.6.1 | 29 46 |
41 64 |
57 89 |
71 79 |
StructureMap 4.7.0 | 1256 838 |
1418 976 |
3402 2081 |
8433 5066 |
Unity 5.8.6 | 302 281 |
437 405 |
1282 1095 |
3962 3553 |
Windsor 4.1.0 | 459 289 |
1772 1050 |
6018 3601 |
19319 10972 |
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.8.1 | 6299 8246 |
1982 2161 |
7889 8397 |
1311 1544 |
70219* 55666 |
16308 16321 |
23726 16331 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.6.0 | 9740 10567 |
4349 4795 |
|||||
Cauldron.Activator 3.0.32 | 54 73 |
72 79 |
325 233 |
655 442 |
|||
DryIoc 3.0.2 | 111 113 |
57 85 |
273 201 |
54 69 |
1000 677 |
848 542 |
|
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.1 | 124 117 |
51 83 |
294 306 |
56 61 |
50764 29199 |
558 407 |
911 634 |
Griffin 1.1.9 | |||||||
HaveBox 2.0.0 | 741 443 |
1860 1198 |
774 509 |
||||
IfInjector 0.8.1 | 345 227 |
147 120 |
|||||
Lamar 1.1.1 | 100 92 |
106 113 |
582 384 |
932 600 |
|||
LightCore 1.5.1 | 2289 1755 |
15862 14477 |
34754 20480 |
||||
LightInject 5.1.8 | 108 115 |
50 84 |
270 213 |
282 197 |
2619 1994 |
1385 906 |
|
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.1.1 | 138 127 |
417 288 |
1051 710 |
||||
Mugen 3.5.1 | 10005 8348 |
72189* 72787* |
5619 7027 |
1824 1883 |
550418* 335171* |
13742 16268 |
|
Munq 3.1.6 | 1536 847 |
||||||
MvvmCross 6.1.2 | 948 1034 |
6458 7098 |
4175 2825 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Rezolver 1.3.4 | 558 366 |
236 186 |
8943 5103 |
8162125* 4734064* |
8679 6836 |
||
SimpleInjector 4.3.0 | 191 207 |
96 118 |
905 776 |
87 88 |
7841 6132 |
||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.6.1 | 104 113 |
51 79 |
273 211 |
60 70 |
297361* 224992* |
851 956 |
934 701 |
StructureMap 4.7.0 | 8664 5149 |
2337 1469 |
8317 4945 |
3145150* 1803094* |
40510 25145 |
7512 4604 |
|
Unity 5.8.6 | 4097 3333 |
1396 1210 |
4815 4031 |
1042 861 |
7035 9942 |
16895 18546 |
|
Windsor 4.1.0 | 39708 20526 |
15333 8640 |
15709 9482 |
236090* 136957* |
16538 7592 |
Container | Prepare And Register | Prepare And Register And Simple Resolve |
---|---|---|
No | 2 |
2 |
abioc 0.7.0 | 5672 |
6613 |
Autofac 4.8.1 | 421 |
445 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 5.6.0 | 7589 |
7883 |
Cauldron.Activator 3.0.32 | 0 |
0 |
DryIoc 3.0.2 | 59 |
217 |
DryIocZero 4.0.0 | 0 |
1 |
Dynamo 3.0.2 | 16240 |
16527 |
fFastInjector 1.0.1 | 6390 |
6336 |
Funq 1.0.0.0 | 8 |
8 |
Grace 6.4.1 | 146 |
776 |
Griffin 1.1.9 | 8387 |
8960 |
HaveBox 2.0.0 | 54925 |
55463 |
IfInjector 0.8.1 | 1397 |
2016 |
Lamar 1.1.1 | 1929 |
314163* |
LightCore 1.5.1 | 226 |
204 |
LightInject 5.1.8 | 108 |
622 |
LinFu 2.3.0.41559 | 107 |
338 |
Maestro 1.5.4 | 172 |
747 |
Mef 4.0.0.0 | 17 |
2299 |
Mef2 1.0.33.0 | 6053 |
7259 |
MicroResolver 2.3.5 | 27322 |
67518 |
MicroSliver 2.1.6 | 12 |
17 |
Microsoft Extensions DependencyInjection 2.1.1 | 24 |
32 |
Mugen 3.5.1 | 424 |
1820 |
Munq 3.1.6 | 9079 |
9500 |
MvvmCross 6.1.2 | 15 |
13 |
Ninject 3.3.4 | 130706* |
126470* |
Rezolver 1.3.4 | 10647 |
16189 |
SimpleInjector 4.3.0 | 771 |
3503 |
Spring.NET 2.0.1 | 25014 |
24884 |
Stashbox 2.6.1 | 87 |
650 |
StructureMap 4.7.0 | 1280 |
7448 |
Unity 5.8.6 | 84 |
79 |
Windsor 4.1.0 | 3098 |
3090 |
The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB