Home

Awesome

Ioc Performance

This

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

ContainerSingletonTransientCombinedComplex
No43<br/>4846<br/>5781<br/>7776<br/>82
abioc 0.7.043<br/>4339<br/>4964<br/>6360<br/>77
Autofac 4.8.1594<br/>639630<br/>5371980<br/>17666417<br/>6534
Caliburn.Micro 1.5.2395<br/>229472<br/>2721390<br/>7715888<br/>3145
Catel 5.6.0258<br/>3013981<br/>44758873<br/>971220584<br/>22965
Cauldron.Activator 3.0.3234<br/>4144<br/>6075<br/>84175<br/>130
DryIoc 3.0.231<br/>4144<br/>6156<br/>7966<br/>70
DryIocZero 4.0.098<br/>7675<br/>7686<br/>94206<br/>144
Dynamo 3.0.285<br/>6893<br/>83207<br/>139621<br/>348
fFastInjector 1.0.169<br/>53116<br/>92242<br/>166558<br/>319
Funq 1.0.0.0109<br/>81133<br/>106366<br/>2451075<br/>592
Grace 6.4.123<br/>3834<br/>6045<br/>7256<br/>63
Griffin 1.1.9274<br/>175291<br/>195628<br/>3861758<br/>988
HaveBox 2.0.038<br/>4547<br/>6164<br/>8097<br/>87
IfInjector 0.8.178<br/>59116<br/>86138<br/>116188<br/>130
Lamar 1.1.163<br/>5679<br/>76104<br/>101119<br/>101
LightCore 1.5.1173<br/>1682281<br/>125425409<br/>35011144838*<br/>198335*
LightInject 5.1.826<br/>3731<br/>5847<br/>7663<br/>62
LinFu 2.3.0.415593037<br/>164416419<br/>1033841746<br/>25356108167*<br/>62903*
Maestro 1.5.4329<br/>237389<br/>265912<br/>5632831<br/>1536
Mef 4.0.0.020118<br/>1098732123<br/>1926254379<br/>50162107807*<br/>131680*
Mef2 1.0.33.0207<br/>136220<br/>153321<br/>214609<br/>352
MicroResolver 2.3.526<br/>4033<br/>5950<br/>6989<br/>79
MicroSliver 2.1.6202<br/>227753<br/>5202395<br/>16436677<br/>5764
Microsoft Extensions DependencyInjection 2.1.177<br/>64108<br/>90135<br/>119187<br/>131
Mugen 3.5.1476<br/>460708<br/>7982063<br/>27757717<br/>10160
Munq 3.1.685<br/>68119<br/>98472<br/>3031561<br/>857
MvvmCross 6.1.2229<br/>252922<br/>9922572<br/>27327434<br/>7995
Ninject 3.3.42613<br/>18907584<br/>626322328<br/>1537361634*<br/>45643
Rezolver 1.3.4165<br/>116181<br/>136246<br/>184378<br/>235
SimpleInjector 4.3.065<br/>5684<br/>7092<br/>89119<br/>96
Spring.NET 2.0.1890<br/>8919550<br/>1318026494<br/>3045169669*<br/>77039*
Stashbox 2.6.130<br/>3836<br/>6151<br/>7764<br/>70
StructureMap 4.7.0994<br/>5571159<br/>7093203<br/>17957992<br/>4478
Unity 5.8.6270<br/>162376<br/>2491108<br/>6343327<br/>1835
Windsor 4.1.0426<br/>2861776<br/>9735787<br/>310816675<br/>8985
Zenject 7.3.0437<br/>5491286<br/>9323610<br/>29879963<br/>6737

Advanced Features

ContainerPropertyGenericsIEnumerableConditionalChild ContainerAsp Net CoreInterception With Proxy
No141<br/>9853<br/>67195<br/>12458<br/>57543<br/>324<br/>439<br/>310
abioc 0.7.0<br/><br/>914<br/>431<br/><br/><br/><br/>
Autofac 4.8.16660<br/>63011774<br/>14147448<br/>60111175<br/>113767161*<br/>3581010851<br/>926220654<br/>10711
Caliburn.Micro 1.5.27819<br/>4036<br/>5951<br/>3160<br/><br/><br/><br/>
Catel 5.6.0<br/>8820<br/>9452<br/><br/><br/><br/>3939<br/>4247
Cauldron.Activator 3.0.3244<br/>6465<br/>72285<br/>193<br/><br/><br/>612<br/>399
DryIoc 3.0.2115<br/>9849<br/>79253<br/>17058<br/>65<br/>870<br/>538787<br/>469
DryIocZero 4.0.0270<br/>18278<br/>78268<br/>183333<br/>224<br/><br/><br/>
Dynamo 3.0.2733<br/>417<br/><br/><br/><br/><br/><br/>
fFastInjector 1.0.1<br/><br/><br/><br/><br/><br/><br/>
Funq 1.0.0.01043<br/>606<br/><br/><br/><br/><br/><br/>
Grace 6.4.192<br/>8944<br/>77244<br/>16248<br/>5843497<br/>23765439<br/>326794<br/>469
Griffin 1.1.9<br/><br/><br/><br/><br/><br/><br/>
HaveBox 2.0.0732<br/>452<br/>1647<br/>954<br/><br/><br/>677<br/>429
IfInjector 0.8.1350<br/>220134<br/>113<br/><br/><br/><br/><br/>
Lamar 1.1.183<br/>81121<br/>101517<br/>317<br/><br/>809<br/>478<br/>
LightCore 1.5.12046<br/>167015474<br/>1737035033<br/>26530<br/><br/><br/><br/>
LightInject 5.1.8100<br/>9841<br/>72238<br/>161328<br/>202<br/>2380<br/>16821301<br/>731
LinFu 2.3.0.41559<br/><br/><br/><br/><br/><br/><br/>
Maestro 1.5.43002<br/>1619660<br/>4152943<br/>1631902<br/>533<br/><br/>5998<br/>3270
Mef 4.0.0.0113888*<br/>137699*129008*<br/>109517*89816*<br/>110240*<br/><br/><br/><br/>
Mef2 1.0.33.01229<br/>721266<br/>1791303<br/>737<br/><br/><br/><br/>
MicroResolver 2.3.534<br/>54<br/>251<br/>175<br/><br/><br/><br/>
MicroSliver 2.1.6<br/><br/><br/><br/><br/><br/><br/>
Microsoft Extensions DependencyInjection 2.1.1<br/>129<br/>110389<br/>238<br/><br/>942<br/>600<br/>
Mugen 3.5.110338<br/>1036855300<br/>575075407<br/>76951638<br/>2153573933*<br/>376419*<br/>14189<br/>29322
Munq 3.1.61469<br/>818<br/><br/><br/><br/><br/><br/>
MvvmCross 6.1.2948<br/>10276198<br/>6536<br/><br/>4088<br/>2418<br/><br/>
Ninject 3.3.458388<br/>4106224518<br/>1522061256*<br/>4238019949<br/>11790435571000*<br/>365734939*<br/>17204<br/>14491
Rezolver 1.3.4534<br/>325239<br/>1728946<br/>4642<br/>8179875*<br/>4415881*9143<br/>6857<br/>
SimpleInjector 4.3.0218<br/>14870<br/>77742<br/>40778<br/>72<br/><br/>7165<br/>4037
Spring.NET 2.0.151391<br/>62415*<br/><br/><br/><br/><br/>42185<br/>54271
Stashbox 2.6.1106<br/>9948<br/>72257<br/>17052<br/>58317873*<br/>219028*676<br/>1042848<br/>497
StructureMap 4.7.08417<br/>46962223<br/>13158352<br/>4592<br/>3196473*<br/>1749431*44306<br/>253187541<br/>4091
Unity 5.8.63332<br/>18811144<br/>6614049<br/>2263834<br/>4675863<br/>940614369<br/>13913<br/>
Windsor 4.1.032879<br/>1779514091<br/>751714856<br/>8174<br/>205541*<br/>108275*<br/>13683<br/>7150
Zenject 7.3.013240<br/>81446796<br/>414913243<br/>88632923<br/>230721211<br/>11956<br/><br/>

Prepare

ContainerPrepare And RegisterPrepare And Register And Simple Resolve
No1<br/>1<br/>
abioc 0.7.06048<br/>5631<br/>
Autofac 4.8.1276<br/>288<br/>
Caliburn.Micro 1.5.248<br/>49<br/>
Catel 5.6.017604<br/>18036<br/>
Cauldron.Activator 3.0.320<br/>0<br/>
DryIoc 3.0.253<br/>246<br/>
DryIocZero 4.0.00<br/>1<br/>
Dynamo 3.0.216854<br/>16871<br/>
fFastInjector 1.0.17283<br/>7401<br/>
Funq 1.0.0.07<br/>7<br/>
Grace 6.4.1137<br/>858<br/>
Griffin 1.1.99131<br/>9201<br/>
HaveBox 2.0.051547<br/>51582<br/>
IfInjector 0.8.11326<br/>1968<br/>
Lamar 1.1.11804<br/>325983*<br/>
LightCore 1.5.1172<br/>188<br/>
LightInject 5.1.8178<br/>800<br/>
LinFu 2.3.0.4155994<br/>330<br/>
Maestro 1.5.4174<br/>785<br/>
Mef 4.0.0.014<br/>2119<br/>
Mef2 1.0.33.05079<br/>6485<br/>
MicroResolver 2.3.526713<br/>65064<br/>
MicroSliver 2.1.611<br/>15<br/>
Microsoft Extensions DependencyInjection 2.1.120<br/>27<br/>
Mugen 3.5.1428<br/>1757<br/>
Munq 3.1.610195<br/>10276<br/>
MvvmCross 6.1.29<br/>12<br/>
Ninject 3.3.4864750*<br/>828996*<br/>
Rezolver 1.3.410680<br/>16192<br/>
SimpleInjector 4.3.0623<br/>3106<br/>
Spring.NET 2.0.122250<br/>22311<br/>
Stashbox 2.6.160<br/>510<br/>
StructureMap 4.7.01374<br/>7347<br/>
Unity 5.8.664<br/>66<br/>
Windsor 4.1.02847<br/>2882<br/>
Zenject 7.3.0137<br/>146<br/>

Charts

<img src="docs/img/Overview_Basic_Slow.png" width="800" height="600" /> <img src="docs/img/Overview_Prepare_Fast.png" width="800" height="600" /> <img src="docs/img/13-Prepare And Register And Simple Resolve.png" width="800" height="600" /> <img src="docs/img/12-Prepare And Register.png" width="800" height="600" />