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.6 | 33 45 |
43 74 |
60 105 |
80 90 |
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.0.0 | 25 45 |
35 55 |
54 87 |
68 79 |
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.5 | 60 63 |
69 76 |
92 128 |
115 136 |
LightCore 1.5.1 | 184 189 |
2191 1301 |
26718 31570 |
151128* 188142* |
LightInject 6.0.0 | 33 47 |
37 62 |
54 86 |
77 83 |
LinFu 2.3.0.41559 | 3167 1709 |
16506 11878 |
45492 29568 |
116514* 76757* |
Maestro 3.6.0 | 329 229 |
304 215 |
543 387 |
1483 962 |
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 |
Microsoft.VisualStudio.Composition 16.3.7 | 9038 5513 |
13564 9786 |
21998 14979 |
58226 51558 |
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.3.1 | 240 283 |
996 1123 |
2627 2889 |
7351 8498 |
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 | 58 53 |
67 72 |
85 107 |
125 113 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.7.8 | 34 47 |
46 68 |
61 86 |
77 83 |
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.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.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.6 | 124 117 |
63 79 |
302 215 |
60 76 |
1879 1331 |
818 530 |
|
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.0.0 | 110 109 |
50 80 |
266 201 |
47 69 |
52706 30542 |
786 750 |
902 602 |
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.5 | 74 80 |
89 133 |
519 Error |
1667 1563 |
|||
LightCore 1.5.1 | 2289 1755 |
15862 14477 |
34754 20480 |
||||
LightInject 6.0.0 | 115 114 |
51 81 |
288 211 |
411 280 |
8778 6569 |
2401 1539 |
|
LinFu 2.3.0.41559 | |||||||
Maestro 3.6.0 | 3402 2335 |
514 294 |
1598 1079 |
9639 7096 |
10385 3878 |
||
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 |
2852 1840 |
||||
Microsoft.VisualStudio.Composition 16.3.7 | 44057 32016 |
40959 34851 |
|||||
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.3.1 | 1236 1343 |
6518 6917 |
4151 2704 |
||||
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 | 92 74 |
626 416 |
915 678 |
||||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.7.8 | 125 119 |
58 83 |
304 222 |
59 69 |
174697* 99904* |
1647 1429 |
832 554 |
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.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