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.7.0 | 27 38 |
32 54 |
48 73 |
64 71 |
Autofac 4.8.1 | 908 914 |
804 818 |
1917 2140 |
6597 7581 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 5.5.0 | 401 496 |
5140 5927 |
10930 13791 |
25721 32013 |
Cauldron.Activator 3.0.29 | 37 48 |
43 61 |
90 106 |
184 145 |
DryIoc 3.0.0 | 32 46 |
43 64 |
57 88 |
67 79 |
DryIocZero 4.0.0-preview-15 | 110 99 |
90 94 |
96 110 |
219 170 |
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 6.4.0 | 28 43 |
41 53 |
60 75 |
73 100 |
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 |
LightCore 1.5.1 | 184 189 |
2191 1301 |
26718 31570 |
151128* 188142* |
LightInject 5.1.4 | 31 44 |
36 60 |
54 81 |
66 82 |
LinFu 2.3.0.41559 | 3167 1709 |
16506 11878 |
45492 29568 |
116514* 76757* |
Maestro 1.5.4 | 356 254 |
1755 2906 |
2437 1743 |
4342 2528 |
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.1.1 | 81 69 |
116 106 |
152 134 |
199 152 |
Mugen 3.5.1 | 484 444 |
711 751 |
2285 2494 |
8297 9494 |
Munq 3.1.6 | 90 75 |
161 107 |
517 417 |
1812 1050 |
MvvmCross 6.1.2 | 233 285 |
962 1011 |
2617 2855 |
7756 8181 |
Ninject 3.3.4 | 3473 2563 |
8686 6969 |
23529 17635 |
63579* 49285 |
Rezolver 1.3.3 | 170 153 |
207 186 |
255 238 |
428 390 |
SimpleInjector 4.3.0 | 74 77 |
100 90 |
111 109 |
119 126 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.6.0 | 31 45 |
45 62 |
56 89 |
74 81 |
StructureMap 4.6.1 | 1169 739 |
1367 922 |
3741 2261 |
9203 5407 |
Unity 5.8.6 | 302 281 |
437 405 |
1282 1095 |
3962 3553 |
Windsor 4.1.0 | 459 289 |
1772 1050 |
6018 3601 |
19319 10972 |
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.7.0 | 743 453 |
||||||
Autofac 4.8.1 | 6299 8246 |
1982 2161 |
7889 8397 |
1311 1544 |
70219* 55666 |
16308 16321 |
23726 16331 |
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 5.5.0 | 10866 13647 |
4954 10575 |
|||||
Cauldron.Activator 3.0.29 | 51 66 |
77 84 |
325 232 |
650 434 |
|||
DryIoc 3.0.0 | 115 117 |
56 77 |
270 200 |
50 69 |
1018 664 |
826 508 |
|
DryIocZero 4.0.0-preview-15 | 286 200 |
87 91 |
307 281 |
403 278 |
|||
Dynamo 3.0.2 | 828 455 |
||||||
fFastInjector 1.0.1 | |||||||
Funq 1.0.0.0 | 1090 639 |
||||||
Grace 6.4.0 | 108 126 |
49 67 |
357 360 |
68 67 |
47907 30596 |
522 417 |
854 572 |
Griffin 1.1.9 | |||||||
HaveBox 2.0.0 | 741 443 |
1860 1198 |
774 509 |
||||
IfInjector 0.8.1 | 345 227 |
147 120 |
|||||
LightCore 1.5.1 | 2289 1755 |
15862 14477 |
34754 20480 |
||||
LightInject 5.1.4 | 110 110 |
51 81 |
257 199 |
308 215 |
2355 1794 |
1347 795 |
|
LinFu 2.3.0.41559 | |||||||
Maestro 1.5.4 | 4502 2616 |
2103 2128 |
4443 2483 |
2186 1691 |
7591 4418 |
||
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.1.1 | 141 135 |
411 291 |
1004 676 |
||||
Mugen 3.5.1 | 10005 8348 |
72189* 72787* |
5619 7027 |
1824 1883 |
550418* 335171* |
13742 16268 |
|
Munq 3.1.6 | 1536 847 |
||||||
MvvmCross 6.1.2 | 948 1034 |
6458 7098 |
4175 2825 |
||||
Ninject 3.3.4 | 62765* 47908 |
24256 15895 |
64193* 49074 |
19294 12954 |
73303000* 50234113* |
20215 15029 |
|
Rezolver 1.3.3 | 553 482 |
233 228 |
10897 8336 |
9544000* 6972002* |
10816 9875 |
||
SimpleInjector 4.3.0 | 191 207 |
96 118 |
905 776 |
87 88 |
7841 6132 |
||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.6.0 | 109 115 |
54 68 |
276 211 |
47 67 |
284231* 205433* |
760 887 |
859 557 |
StructureMap 4.6.1 | 9409 5581 |
2543 1599 |
9224 5432 |
3389333* 1980624* |
48834 28827 |
8300 4778 |
|
Unity 5.8.6 | 4097 3333 |
1396 1210 |
4815 4031 |
1042 861 |
7035 9942 |
16895 18546 |
|
Windsor 4.1.0 | 39708 20526 |
15333 8640 |
15709 9482 |
236090* 136957* |
16538 7592 |
Prepare
Container | Prepare And Register | Prepare And Register And Simple Resolve |
---|---|---|
No | 2 |
2 |
abioc 0.7.0 | 5672 |
6613 |
Autofac 4.8.1 | 421 |
445 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 5.5.0 | 9507 |
10047 |
Cauldron.Activator 3.0.29 | 0 |
0 |
DryIoc 3.0.0 | 59 |
222 |
DryIocZero 4.0.0-preview-15 | 0 |
1 |
Dynamo 3.0.2 | 16240 |
16527 |
fFastInjector 1.0.1 | 6390 |
6336 |
Funq 1.0.0.0 | 8 |
8 |
Grace 6.4.0 | 145 |
809 |
Griffin 1.1.9 | 8387 |
8960 |
HaveBox 2.0.0 | 54925 |
55463 |
IfInjector 0.8.1 | 1397 |
2016 |
LightCore 1.5.1 | 226 |
204 |
LightInject 5.1.4 | 104 |
626 |
LinFu 2.3.0.41559 | 107 |
338 |
Maestro 1.5.4 | 172 |
747 |
Mef 4.0.0.0 | 17 |
2299 |
Mef2 1.0.33.0 | 6053 |
7259 |
MicroResolver 2.3.5 | 27322 |
67518 |
MicroSliver 2.1.6 | 12 |
17 |
Microsoft Extensions DependencyInjection 2.1.1 | 22 |
28 |
Mugen 3.5.1 | 424 |
1820 |
Munq 3.1.6 | 9079 |
9500 |
MvvmCross 6.1.2 | 15 |
13 |
Ninject 3.3.4 | 130706* |
126470* |
Rezolver 1.3.3 | 13353 |
19672 |
SimpleInjector 4.3.0 | 771 |
3503 |
Spring.NET 2.0.1 | 25014 |
24884 |
Stashbox 2.6.0 | 73 |
463 |
StructureMap 4.6.1 | 1536 |
7909 |
Unity 5.8.6 | 84 |
79 |
Windsor 4.1.0 | 3098 |
3090 |
Charts
Machine
The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB