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 | 61 53 |
68 62 |
83 103 |
90 82 |
abioc 0.7.0 | 27 38 |
32 54 |
48 73 |
64 71 |
Autofac 4.6.2 | 766 650 |
769 558 |
1950 1785 |
6685 6442 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.2.0 | 299 327 |
4165 4575 |
9855 10911 |
23025 23582 |
DryIoc 2.12.7 | 29 48 |
43 64 |
63 92 |
73 93 |
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.3.1 | 27 46 |
35 59 |
53 83 |
67 81 |
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 |
LightCore 1.5.1 | 184 189 |
2191 1301 |
26718 31570 |
151128* 188142* |
LightInject 5.1.2 | 28 45 |
36 62 |
54 82 |
72 81 |
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.32.0 | 309 217 |
267 174 |
363 241 |
693 411 |
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.0.0 | 198 223 |
112 92 |
301 319 |
1121 1176 |
Mugen 3.5.1 | 484 444 |
711 751 |
2285 2494 |
8297 9494 |
Munq 3.1.6 | 90 75 |
161 107 |
517 417 |
1812 1050 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Rezolver 1.3.1 | 147 111 |
175 130 |
234 183 |
391 248 |
SimpleInjector 4.0.12 | 64 56 |
91 74 |
96 86 |
126 101 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.5.6 | 30 46 |
37 68 |
55 87 |
73 84 |
StructureMap 4.6.1 | 1169 739 |
1367 922 |
3741 2261 |
9203 5407 |
Unity 5.5.8 | 1086 777 |
2084 1305 |
5666 3657 |
16360 11002 |
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 | 119 99 |
73 79 |
177 139 |
78 69 |
606 361 |
72 65 |
|
abioc 0.7.0 | 743 453 |
||||||
Autofac 4.6.2 | 6261 6291 |
1953 1493 |
7891 6279 |
1719 1686 |
56905 35305 |
14203 12404 |
23633 12450 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.2.0 | 10209 10257 |
4231 4578 |
|||||
DryIoc 2.12.7 | 108 106 |
63 84 |
293 218 |
65 76 |
898 563 |
||
Dynamo 3.0.2 | 828 455 |
||||||
fFastInjector 1.0.1 | |||||||
Funq 1.0.0.0 | 1090 639 |
||||||
Grace 6.3.1 | 91 101 |
49 78 |
287 207 |
57 71 |
51061 31231 |
517 405 |
896 611 |
Griffin 1.1.9 | |||||||
HaveBox 2.0.0 | 741 443 |
1860 1198 |
774 509 |
||||
IfInjector 0.8.1 | 345 227 |
147 120 |
|||||
LightCore 1.5.1 | 2289 1755 |
15862 14477 |
34754 20480 |
||||
LightInject 5.1.2 | 96 104 |
51 82 |
285 211 |
351 245 |
2416 1965 |
1480 877 |
|
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.32.0 | 1408 819 |
309 213 |
1425 811 |
||||
MicroResolver 2.3.5 | 39 62 |
262 195 |
|||||
MicroSliver 2.1.6 | |||||||
Microsoft Extensions DependencyInjection 2.0.0 | 125 108 |
402 265 |
1931 1614 |
||||
Mugen 3.5.1 | 10005 8348 |
72189* 72787* |
5619 7027 |
1824 1883 |
550418* 335171* |
13742 16268 |
|
Munq 3.1.6 | 1536 847 |
||||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Rezolver 1.3.1 | 530 327 |
201 165 |
9391 4819 |
7226777* 3858842* |
9039 7341 |
||
SimpleInjector 4.0.12 | 178 138 |
76 77 |
778 462 |
83 81 |
7097 4028 |
||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.5.6 | 109 114 |
53 83 |
274 209 |
62 73 |
172632* 102173* |
655 852 |
860 574 |
StructureMap 4.6.1 | 9409 5581 |
2543 1599 |
9224 5432 |
3389333* 1980624* |
48834 28827 |
8300 4778 |
|
Unity 5.5.8 | 16965 10925 |
11360 6267 |
33845 19406 |
4687 2814 |
33502 21859 |
58843 41860 |
|
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 |
3 |
abioc 0.7.0 | 5672 |
6613 |
Autofac 4.6.2 | 287 |
304 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 5.2.0 | 6956 |
7499 |
DryIoc 2.12.7 | 60 |
245 |
Dynamo 3.0.2 | 16240 |
16527 |
fFastInjector 1.0.1 | 6390 |
6336 |
Funq 1.0.0.0 | 8 |
8 |
Grace 6.3.1 | 162 |
812 |
Griffin 1.1.9 | 8387 |
8960 |
HaveBox 2.0.0 | 54925 |
55463 |
IfInjector 0.8.1 | 1397 |
2016 |
LightCore 1.5.1 | 226 |
204 |
LightInject 5.1.2 | 167 |
747 |
LinFu 2.3.0.41559 | 107 |
338 |
Maestro 1.5.4 | 172 |
747 |
Mef 4.0.0.0 | 17 |
2299 |
Mef2 1.0.32.0 | 5684 |
6729 |
MicroResolver 2.3.5 | 27322 |
67518 |
MicroSliver 2.1.6 | 12 |
17 |
Microsoft Extensions DependencyInjection 2.0.0 | 21 |
29 |
Mugen 3.5.1 | 424 |
1820 |
Munq 3.1.6 | 9079 |
9500 |
Ninject 3.3.4 | 130706* |
126470* |
Rezolver 1.3.1 | 8024 |
12642 |
SimpleInjector 4.0.12 | 618 |
3126 |
Spring.NET 2.0.1 | 25014 |
24884 |
Stashbox 2.5.6 | 71 |
250 |
StructureMap 4.6.1 | 1536 |
7909 |
Unity 5.5.8 | 142 |
951 |
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