IocPerformance
IocPerformance copied to clipboard
Performance comparison of .NET IoC containers
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.3.0 | 744 541 |
887 637 |
2463 1539 |
7421 4568 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.12.22 | 250 296 |
3979 4314 |
8954 9876 |
25104 23025 |
DryIoc 4.8.5 | 63 54 |
73 73 |
89 100 |
110 101 |
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.1 | 20 31 |
39 55 |
52 84 |
73 83 |
Lamar 6.0.0 | 51 59 |
74 79 |
98 110 |
108 109 |
LightInject 6.4.0 | 46 47 |
45 57 |
88 99 |
153 143 |
Maestro 3.6.6 | 386 269 |
342 241 |
580 438 |
1411 1097 |
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.2 | 205 251 |
1318 1402 |
3316 3726 |
8677 9516 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Pure.DI 1.1.39 | 24 37 |
42 59 |
56 84 |
72 84 |
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 3.0.0 | 553 446 |
2533 1535 |
8190 5084 |
23729 15167 |
Stashbox 3.6.4 | 33 42 |
57 64 |
68 96 |
85 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 |
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.3.0 | 7448 4570 |
2165 1445 |
8127 5176 |
1858 1195 |
75548* 57801 |
46484 41519 |
28432 16233 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.12.22 | 8872 9710 |
3937 4257 |
|||||
DryIoc 4.8.5 | 144 131 |
86 88 |
294 219 |
81 79 |
1379 1005 |
835 555 |
|
DryIocZero 4.0.0 | 294 205 |
92 92 |
302 229 |
380 270 |
|||
Dynamo 3.0.2 | 828 455 |
||||||
Grace 7.2.1 | 101 112 |
50 80 |
257 210 |
45 70 |
50375 32231 |
657 674 |
827 571 |
Lamar 6.0.0 | 83 84 |
90 100 |
473 366 |
4268 3886 |
|||
LightInject 6.4.0 | 185 150 |
61 77 |
294 239 |
384 285 |
2268 1643 |
1548 1062 |
|
Maestro 3.6.6 | 3886 2438 |
419 318 |
1272 843 |
10764 8560 |
6757 3630 |
||
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.2 | 1310 1415 |
6576 7299 |
4968 3230 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Pure.DI 1.1.39 | 47 66 |
54 72 |
179 156 |
50 72 |
230 208 |
||
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 3.0.0 | 18982 11962 |
18461 11065 |
|||||
Stashbox 3.6.4 | 112 116 |
61 79 |
273 217 |
60 68 |
329202* 215002* |
1403 1155 |
809 548 |
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.3.0 | 374 |
363 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 5.12.22 | 11925 |
9956 |
DryIoc 4.8.5 | 56 |
64 |
DryIocZero 4.0.0 | 0 |
1 |
Dynamo 3.0.2 | 16240 |
16527 |
Grace 7.2.1 | 157 |
966 |
Lamar 6.0.0 | 2006 |
2437 |
LightInject 6.4.0 | 131 |
1686 |
Maestro 3.6.6 | 128 |
144 |
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.2 | 10 |
16 |
Ninject 3.3.4 | 130706* |
126470* |
Pure.DI 1.1.39 | 0 |
|
Rezolver 2.1.0 | 20835 |
27706 |
SimpleInjector 5.3.2 | 639 |
3011 |
Singularity 0.18.0 | 314 |
874 |
Spring.NET 3.0.0 | 14198 |
14141 |
Stashbox 3.6.4 | 56 |
578 |
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