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.8.0 | 26 43 |
33 56 |
51 82 |
67 78 |
Autofac 4.9.4 | 593 389 |
754 504 |
1953 1191 |
5877 3609 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.11.2 | 262 308 |
4283 4695 |
9693 10646 |
22248 24653 |
DryIoc 4.0.7 | 36 49 |
56 79 |
57 102 |
76 89 |
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 7.1.0 | 26 42 |
36 62 |
55 83 |
67 83 |
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.1.0 | 58 68 |
70 103 |
99 121 |
119 138 |
LightCore 1.5.1 | 184 189 |
2191 1301 |
26718 31570 |
151128* 188142* |
LightInject 6.2.0 | 30 47 |
37 66 |
56 89 |
78 88 |
LinFu 2.3.0.41559 | 3167 1709 |
16506 11878 |
45492 29568 |
116514* 76757* |
Maestro 3.6.2 | 365 254 |
302 211 |
540 390 |
1493 979 |
Mef 4.0.0.0 | 22679 11820 |
37640 25052 |
57462 68730* |
112712* 131716* |
Mef2 1.0.34.0 | 230 172 |
236 179 |
367 251 |
679 438 |
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 3.0.0 | 85 84 |
108 101 |
128 124 |
143 129 |
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.4.1 | 254 288 |
1326 1426 |
3440 3721 |
10322 9997 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Rezolver 2.0.0 | 91 98 |
120 93 |
174 147 |
303 231 |
SimpleInjector 4.7.1 | 80 77 |
96 93 |
128 121 |
169 144 |
Singularity 0.14.0 | 24 45 |
38 61 |
50 88 |
65 82 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.8.5 | 39 55 |
46 68 |
65 92 |
90 112 |
StructureMap 4.7.1 | 1121 717 |
1281 856 |
3410 2166 |
8312 6052 |
Unity 5.11.1 | 231 160 |
1598 926 |
3599 1995 |
8365 4647 |
Windsor 5.0.1 | 454 342 |
1796 1092 |
5618 3523 |
16853 10289 |
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.8.0 | 799 506 |
||||||
Autofac 4.9.4 | 6070 3626 |
2243 1377 |
7838 4615 |
1445 901 |
84497* 53089 |
35800 21902 |
22852 14654 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.11.2 | 9585 10434 |
4295 4634 |
|||||
DryIoc 4.0.7 | 122 123 |
58 83 |
326 232 |
58 78 |
1842 1358 |
838 540 |
|
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 7.1.0 | 104 116 |
49 87 |
291 215 |
47 70 |
54478 32637 |
868 680 |
1151 689 |
Griffin 1.1.9 | |||||||
HaveBox 2.0.0 | 741 443 |
1860 1198 |
774 509 |
||||
IfInjector 0.8.1 | 345 227 |
147 120 |
|||||
Lamar 3.1.0 | 74 89 |
86 127 |
555 410 |
1623 1581 |
|||
LightCore 1.5.1 | 2289 1755 |
15862 14477 |
34754 20480 |
||||
LightInject 6.2.0 | 116 122 |
53 77 |
300 225 |
350 252 |
2291 1627 |
1496 923 |
|
LinFu 2.3.0.41559 | |||||||
Maestro 3.6.2 | 3200 2005 |
385 286 |
1303 837 |
8309 5461 |
5776 3311 |
||
Mef 4.0.0.0 | 124500* 133833* |
137086* 114221* |
97231* 100896* |
||||
Mef2 1.0.34.0 | 1411 881 |
301 219 |
1392 860 |
||||
MicroResolver 2.3.5 | 39 62 |
262 195 |
|||||
MicroSliver 2.1.6 | |||||||
Microsoft Extensions DependencyInjection 3.0.0 | 124 114 |
361 265 |
3020 1967 |
||||
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.4.1 | 1338 1437 |
7389 8213 |
5302 3460 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Rezolver 2.0.0 | 454 360 |
139 156 |
490 354 |
6570200* 4095208* |
59211 33867 |
||
SimpleInjector 4.7.1 | 255 246 |
123 111 |
1390 838 |
78 79 |
7219 4205 |
||
Singularity 0.14.0 | 49 75 |
292 220 |
507 555 |
||||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.8.5 | 142 140 |
67 90 |
358 336 |
65 85 |
203135* 120429* |
1700 1611 |
840 543 |
StructureMap 4.7.1 | 8697 5284 |
2271 1460 |
8399 5170 |
3215578* 1887211* |
65269* 41725 |
7859 4464 |
|
Unity 5.11.1 | 8560 4885 |
9191 5255 |
15421 8702 |
3319 1861 |
119255* 70861* |
54284 39245 |
50324 27704 |
Windsor 5.0.1 | 34532 19632 |
15140 9111 |
15426 9609 |
226334* 120937* |
13105 7493 |
||
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