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 6.2.0 | 732 523 |
893 629 |
2414 1511 |
7819 4625 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.12.17 | 243 289 |
4152 4834 |
9667 10341 |
21141 24573 |
DryIoc 4.8.1 | 60 58 |
69 66 |
87 101 |
107 99 |
DryIocZero 4.0.0 | 110 96 |
88 89 |
98 105 |
220 169 |
Dynamo 3.0.2 | 95 70 |
104 86 |
207 158 |
685 381 |
Grace 7.2.0 | 29 39 |
42 59 |
58 81 |
77 82 |
Lamar 5.0.4 | 87 74 |
86 95 |
148 107 |
157 111 |
LightInject 6.4.0 | 46 47 |
45 57 |
88 99 |
153 143 |
Maestro 3.6.5 | 410 312 |
404 307 |
652 477 |
1547 1204 |
Mef 4.0.0.0 | 22679 11820 |
37640 25052 |
57462 68730* |
112712* 131716* |
Mef2 5.0.0.0 | 259 178 |
252 192 |
355 263 |
657 444 |
MicroResolver 2.3.5 | 25 39 |
34 59 |
55 77 |
92 89 |
Microsoft Extensions DependencyInjection 5.0.2 | 73 57 |
99 81 |
116 109 |
134 113 |
Microsoft.VisualStudio.Composition 16.9.20 | 10657 7328 |
16329 14386 |
28141 18099 |
75101* 66068* |
Mugen MVVM Toolkit 6.5.0 | 102 138 |
409 715 |
2052 2590 |
9348 11352 |
MvvmCross 8.0.1 | 215 272 |
1286 1415 |
3235 3547 |
8254 9387 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Pure.DI 1.0.1 | 27 34 |
35 59 |
56 84 |
74 79 |
Rezolver 2.1.0 | 121 100 |
137 126 |
194 171 |
328 238 |
SimpleInjector 5.3.2 | 56 63 |
91 77 |
119 113 |
127 110 |
Singularity 0.18.0 | 24 39 |
39 59 |
66 82 |
76 84 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 3.6.3 | 42 49 |
53 61 |
65 93 |
87 87 |
StructureMap 4.7.1 | 1121 717 |
1281 856 |
3410 2166 |
8312 6052 |
Unity 5.11.10 | 216 148 |
1443 835 |
3326 1995 |
9503 4739 |
Windsor 5.1.1 | 461 333 |
1839 1127 |
8062 5972 |
19313 13001 |
ZenIoc 1.0.1 | 306 198 |
267 188 |
674 440 |
1809 1103 |
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 6.2.0 | 7562 5979 |
2177 1419 |
8032 4777 |
1799 1160 |
70738* 55892 |
40839 37031 |
22538 12548 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.12.17 | 14033 13485 |
4073 4321 |
|||||
DryIoc 4.8.1 | 134 121 |
83 86 |
283 212 |
80 76 |
1316 1014 |
862 548 |
|
DryIocZero 4.0.0 | 294 205 |
92 92 |
302 229 |
380 270 |
|||
Dynamo 3.0.2 | 828 455 |
||||||
Grace 7.2.0 | 134 113 |
55 78 |
296 242 |
58 83 |
61817* 37329 |
759 815 |
1287 764 |
Lamar 5.0.4 | 193 91 |
158 97 |
606 423 |
4303 3680 |
|||
LightInject 6.4.0 | 185 150 |
61 77 |
294 239 |
384 285 |
2268 1643 |
1548 1062 |
|
Maestro 3.6.5 | 4824 3118 |
472 354 |
1400 942 |
12236 10304 |
6134 4361 |
||
Mef 4.0.0.0 | 124500* 133833* |
137086* 114221* |
97231* 100896* |
||||
Mef2 5.0.0.0 | 1431 1012 |
290 226 |
1343 895 |
||||
MicroResolver 2.3.5 | 39 62 |
262 195 |
|||||
Microsoft Extensions DependencyInjection 5.0.2 | 114 100 |
304 234 |
3618 2299 |
||||
Microsoft.VisualStudio.Composition 16.9.20 | 56863 39925 |
69695* 46056 |
|||||
Mugen MVVM Toolkit 6.5.0 | 436 705 |
9749 7094 |
4370 3103 |
||||
MvvmCross 8.0.1 | 1285 1420 |
6141 8031 |
4811 3269 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Pure.DI 1.0.1 | 45 65 |
54 71 |
179 149 |
49 68 |
|||
Rezolver 2.1.0 | 520 385 |
183 145 |
669 408 |
9589857* 5697265* |
86587* 56374 |
||
SimpleInjector 5.3.2 | 254 187 |
111 106 |
586 360 |
106 90 |
5382 3141 |
||
Singularity 0.18.0 | 54 80 |
241 193 |
631 652 |
||||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 3.6.3 | 124 118 |
61 80 |
274 202 |
64 69 |
338382* 215528* |
1414 1146 |
874 541 |
StructureMap 4.7.1 | 8697 5284 |
2271 1460 |
8399 5170 |
3215578* 1887211* |
65269* 41725 |
7859 4464 |
|
Unity 5.11.10 | 9045 5814 |
9842 6443 |
17755 12048 |
3547 2046 |
147355* 74313* |
61350* 39009 |
56226 31096 |
Windsor 5.1.1 | 40830 22225 |
15542 9318 |
19361 10763 |
242149* 176823* |
18018 8775 |
||
ZenIoc 1.0.1 | 264 195 |
276 209 |
704 488 |
314 222 |
602490* 471765* |
||
Zenject 8.0.0 | 15829 13135 |
9021 6513 |
17932 12687 |
3082 2428 |
22250 18595 |
Container | Prepare And Register | Prepare And Register And Simple Resolve |
---|---|---|
No | 2 |
2 |
abioc 0.8.0 | 6327 |
6556 |
Autofac 6.2.0 | 317 |
347 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 5.12.17 | 10596 |
9233 |
DryIoc 4.8.1 | 57 |
62 |
DryIocZero 4.0.0 | 0 |
1 |
Dynamo 3.0.2 | 16240 |
16527 |
Grace 7.2.0 | 234 |
1340 |
Lamar 5.0.4 | 1955 |
2527 |
LightInject 6.4.0 | 131 |
1686 |
Maestro 3.6.5 | 149 |
162 |
Mef 4.0.0.0 | 17 |
2299 |
Mef2 5.0.0.0 | 4715 |
6984 |
MicroResolver 2.3.5 | 27322 |
67518 |
Microsoft Extensions DependencyInjection 5.0.2 | 21 |
30 |
Microsoft.VisualStudio.Composition 16.9.20 | 11600 |
11473 |
Mugen MVVM Toolkit 6.5.0 | 15 |
19 |
MvvmCross 8.0.1 | 10 |
14 |
Ninject 3.3.4 | 130706* |
126470* |
Pure.DI 1.0.1 | 0 |
|
Rezolver 2.1.0 | 20835 |
27706 |
SimpleInjector 5.3.2 | 639 |
3011 |
Singularity 0.18.0 | 314 |
874 |
Spring.NET 2.0.1 | 25014 |
24884 |
Stashbox 3.6.3 | 57 |
562 |
StructureMap 4.7.1 | 1325 |
7389 |
Unity 5.11.10 | 122 |
287 |
Windsor 5.1.1 | 2949 |
3445 |
ZenIoc 1.0.1 | 77 |
964 |
Zenject 8.0.0 | 199 |
201 |
The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB