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 | 61 53 |
68 62 |
83 103 |
90 82 |
abioc 0.4.0 | 23 38 |
34 58 |
46 84 |
61 70 |
Autofac 4.6.0 | 754 675 |
979 790 |
2658 2151 |
8276 8187 |
Caliburn.Micro 1.5.2 | 465 270 |
533 322 |
1583 906 |
7403 3712 |
Catel 4.5.4 | 309 356 |
4119 4510 |
10048 11082 |
24815 26422 |
DryIoc 2.10.4 | 29 42 |
38 63 |
55 80 |
62 70 |
DryIocZero 2.7.0 | 91 75 |
75 74 |
107 110 |
338 231 |
Dynamo 3.0.2.0 | 83 81 |
92 96 |
201 153 |
655 384 |
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.2.0 | 31 43 |
42 63 |
56 86 |
72 84 |
Griffin 1.1.4 | 280 182 |
304 203 |
657 431 |
1888 1114 |
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.0.3 | 28 41 |
36 61 |
56 81 |
68 83 |
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.30.0 | 239 167 |
254 174 |
332 256 |
528 317 |
MicroSliver 2.1.6.0 | 193 235 |
725 611 |
2394 1613 |
6829 5881 |
Microsoft Extensions DependencyInjection 1.1.1 | 207 268 |
167 141 |
463 452 |
1608 1668 |
Mugen 3.5.1 | 484 444 |
711 751 |
2285 2494 |
8297 9494 |
Munq 3.1.6 | 90 75 |
161 107 |
517 417 |
1812 1050 |
Ninject 3.2.2.0 | 5192 3216 |
16735 11856 |
44930 30318 |
131301* 84559* |
Petite 0.3.2 | 3856 2093 |
3931 2293 |
4330 2283 |
5198 2766 |
Rezolver 1.2.7050.900 | 135 104 |
176 135 |
227 177 |
367 238 |
SimpleInjector 4.0.7 | 68 62 |
80 69 |
112 114 |
155 140 |
Spring.NET 2.0.1 | 950 987 |
9711 11447 |
26941 23873 |
74745* 57777 |
Stashbox 2.5.1 | 41 54 |
57 65 |
81 89 |
96 93 |
StructureMap 4.4.5 | 1231 886 |
1197 775 |
3468 2069 |
8513 4896 |
StyleMVVM 3.1.5 | 441 263 |
480 299 |
748 437 |
1409 795 |
TinyIoC 1.3 | 420 473 |
1683 1081 |
7344 5164 |
32219 23617 |
Unity 4.0.1 | 2517 1375 |
3761 1962 |
10161 5372 |
27963 16013 |
Container | Property | Generics | IEnumerable | Conditional | Child Container | Asp Net Core | Interception With Proxy |
---|---|---|---|---|---|---|---|
No | 119 99 |
73 79 |
177 139 |
78 69 |
606 361 |
72 65 |
|
abioc 0.4.0 | 783 452 |
||||||
Autofac 4.6.0 | 21496 13869 |
1944 1614 |
9214 6569 |
62344* 41584 |
15906 13327 |
26474 14361 |
|
Caliburn.Micro 1.5.2 | 9157 4733 |
5965 3393 |
|||||
Catel 4.5.4 | 10636 11485 |
4354 4492 |
|||||
DryIoc 2.10.4 | 82 92 |
50 84 |
259 184 |
56 66 |
766 502 |
||
DryIocZero 2.7.0 | 394 256 |
319 214 |
58 62 |
||||
Dynamo 3.0.2.0 | 796 467 |
||||||
fFastInjector 1.0.1 | |||||||
Funq 1.0.0.0 | 1090 639 |
||||||
Grace 6.2.0 | 110 110 |
58 75 |
328 214 |
61 73 |
57596 33066 |
563 417 |
941 599 |
Griffin 1.1.4 | |||||||
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.0.3 | 107 93 |
47 207 |
263 245 |
375 299 |
2276 1616 |
1346 788 |
|
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.30.0 | 1188 680 |
261 429 |
1345 758 |
||||
MicroSliver 2.1.6.0 | |||||||
Microsoft Extensions DependencyInjection 1.1.1 | 226 169 |
876 521 |
1888 1812 |
||||
Mugen 3.5.1 | 10005 8348 |
72189* 72787* |
5619 7027 |
1824 1883 |
550418* 335171* |
13742 16268 |
|
Munq 3.1.6 | 1536 847 |
||||||
Ninject 3.2.2.0 | 112654* 76631* |
48775 27198 |
102856* 68908* |
34283 22799 |
46654500* 41128767* |
24945 15694 |
|
Petite 0.3.2 | 6684 3636 |
||||||
Rezolver 1.2.7050.900 | 500 317 |
218 161 |
588 364 |
3143050* 1677185* |
10298 7844 |
||
SimpleInjector 4.0.7 | 267 198 |
88 88 |
981 578 |
93 82 |
7814 4473 |
||
Spring.NET 2.0.1 | 52419 51992 |
43647 43419 |
|||||
Stashbox 2.5.1 | 108 105 |
69 79 |
322 230 |
74 73 |
196026* 115709* |
834 592 |
968 595 |
StructureMap 4.4.5 | 9008 4985 |
2255 1391 |
8607 4782 |
3224052* 1683463* |
40641 24088 |
7863 4252 |
|
StyleMVVM 3.1.5 | 1542 914 |
1234 708 |
3067 2022 |
1432 745 |
|||
TinyIoC 1.3 | 5676 5769 |
14183 7663 |
|||||
Unity 4.0.1 | 29064 16150 |
43685 23347 |
33727 19896 |
93122* 49665 |
Container | Prepare And Register | Prepare And Register And Simple Resolve |
---|---|---|
No | 2 |
3 |
abioc 0.4.0 | 5191 |
5466 |
Autofac 4.6.0 | 361 |
390 |
Caliburn.Micro 1.5.2 | 55 |
56 |
Catel 4.5.4 | 7844 |
8192 |
DryIoc 2.10.4 | 78 |
252 |
DryIocZero 2.7.0 | 0 |
1 |
Dynamo 3.0.2.0 | 15818 |
15809 |
fFastInjector 1.0.1 | 6390 |
6336 |
Funq 1.0.0.0 | 8 |
8 |
Grace 6.2.0 | 166 |
868 |
Griffin 1.1.4 | 8442 |
7933 |
HaveBox 2.0.0 | 54925 |
55463 |
IfInjector 0.8.1 | 1397 |
2016 |
LightCore 1.5.1 | 226 |
204 |
LightInject 5.0.3 | 148 |
647 |
LinFu 2.3.0.41559 | 107 |
338 |
Maestro 1.5.4 | 172 |
747 |
Mef 4.0.0.0 | 17 |
2299 |
Mef2 1.0.30.0 | 5585 |
7329 |
MicroSliver 2.1.6.0 | 11 |
16 |
Microsoft Extensions DependencyInjection 1.1.1 | 26 |
38 |
Mugen 3.5.1 | 424 |
1820 |
Munq 3.1.6 | 9079 |
9500 |
Ninject 3.2.2.0 | 97125* |
86107* |
Petite 0.3.2 | 22 |
41 |
Rezolver 1.2.7050.900 | 221 |
3286 |
SimpleInjector 4.0.7 | 721 |
3537 |
Spring.NET 2.0.1 | 25014 |
24884 |
Stashbox 2.5.1 | 77 |
517 |
StructureMap 4.4.5 | 1351 |
7153 |
StyleMVVM 3.1.5 | 69968 |
71562 |
TinyIoC 1.3 | 58 |
67 |
Unity 4.0.1 | 588 |
2209 |
The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB