Ioc Performance
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
Results
Explantions
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.
Basic Features
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.1.0 | 702 499 |
882 597 |
2369 1492 |
7249 4391 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.12.11 | 232 282 |
3883 4263 |
9072 9828 |
21140 22450 |
DryIoc 4.7.2 | 61 58 |
93 79 |
93 111 |
115 115 |
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.0 | 70 70 |
163 87 |
100 115 |
129 118 |
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.1 | 73 67 |
103 86 |
126 115 |
146 120 |
Microsoft.VisualStudio.Composition 16.4.11 | 9074 4916 |
13891 9399 |
19760 14962 |
57910 51972 |
Mugen MVVM Toolkit 6.5.0 | 102 138 |
409 715 |
2052 2590 |
9348 11352 |
MvvmCross 7.1.2 | 240 281 |
1470 1585 |
3607 4008 |
10040 11160 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Rezolver 2.1.0 | 121 100 |
137 126 |
194 171 |
328 238 |
SimpleInjector 5.2.1 | 58 66 |
78 84 |
124 114 |
152 116 |
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.5.0 | 35 42 |
63 69 |
69 96 |
86 86 |
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 |
Advanced Features
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.1.0 | 7216 4433 |
2119 1390 |
7780 4789 |
1766 1138 |
95939* 83541* |
40409 35736 |
22350 12007 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.12.11 | 8668 9519 |
3819 4186 |
|||||
DryIoc 4.7.2 | 161 180 |
221 143 |
678 670 |
257 214 |
2979 1308 |
1283 1451 |
|
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.0 | 91 96 |
98 112 |
558 385 |
4685 4364 |
|||
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.1 | 121 100 |
359 254 |
3934 2551 |
||||
Microsoft.VisualStudio.Composition 16.4.11 | 44285 31830 |
42023 35658 |
|||||
Mugen MVVM Toolkit 6.5.0 | 436 705 |
9749 7094 |
4370 3103 |
||||
MvvmCross 7.1.2 | 1448 1642 |
7519 8328 |
5508 3588 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Rezolver 2.1.0 | 520 385 |
183 145 |
669 408 |
9589857* 5697265* |
86587* 56374 |
||
SimpleInjector 5.2.1 | 271 202 |
90 95 |
634 415 |
109 92 |
5457 3398 |
||
Singularity 0.18.0 | 54 80 |
241 193 |
631 652 |
||||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 3.5.0 | 123 117 |
66 73 |
278 213 |
62 70 |
336256* 224444* |
1461 1088 |
835 562 |
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 |
Prepare
Container | Prepare And Register | Prepare And Register And Simple Resolve |
---|---|---|
No | 2 |
2 |
abioc 0.8.0 | 6327 |
6556 |
Autofac 6.1.0 | 651 |
682 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 5.12.11 | 9916 |
9346 |
DryIoc 4.7.2 | 101 |
85 |
DryIocZero 4.0.0 | 0 |
1 |
Dynamo 3.0.2 | 16240 |
16527 |
Grace 7.2.0 | 234 |
1340 |
Lamar 5.0.0 | 2285 |
2849 |
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.1 | 27 |
35 |
Microsoft.VisualStudio.Composition 16.4.11 | 7904 |
8540 |
Mugen MVVM Toolkit 6.5.0 | 15 |
19 |
MvvmCross 7.1.2 | 11 |
16 |
Ninject 3.3.4 | 130706* |
126470* |
Rezolver 2.1.0 | 20835 |
27706 |
SimpleInjector 5.2.1 | 735 |
3327 |
Singularity 0.18.0 | 314 |
874 |
Spring.NET 2.0.1 | 25014 |
24884 |
Stashbox 3.5.0 | 66 |
582 |
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 |
Charts
Machine
The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB