Dependency Injection Framework Speedtest

added by dpeterson
8/13/2011 12:38:23 PM

778 Views

Philip Mateescu shares with us an in-depth and well documented speed test of Autofac v2.4.5.724, Castle.Windsor v2.5.3, Ninject v2.2.0.0, Spring.Net v1.3.1, StructureMap v2.6.1, and Microsoft Unity v2.1.0.0. Spoiler alert, Unity loses big time ;-)


6 comments

vijayst
8/14/2011 4:38:04 AM
A good analysis of the performance of various DI frameworks in .Net. Do the slower frameworks provide more programmable features?

dpeterson
8/15/2011 2:12:10 PM
I don't know that they provide more features, at least not for the time tradeoff. A DI framework is a DI framework, anything beyond that makes it something else IMO.
Sprint.Net can also do some AOP stuff, and is more of an application framework, so I don't know if its results are skewed in this test because of that or not.
As for Autofac vs Ninject vs StructureMap, they all appear to be on equal footing feature-wise (from my cursory inspection). I think their speed differences have more to do with how they were designed rather than whether one is more feature-rich than the other.
I would also put myself out on a limb and say that providing more features isn't necessarily an excuse to perform slowly ;-)

bsenoff
9/14/2011 9:11:13 AM
Best of DNK for August 2011 !

dotnetchris
9/14/2011 10:04:15 PM
StructureMap king as always. Except when it comes to documentation. Thankfully I just have like 3 years of experience with it that I rarely if ever need help doing anything with it.

dpeterson
9/14/2011 10:11:16 PM
In your opinion, how does it compare to the author's favorite, Autofac?

dotnetchris
9/14/2011 10:31:50 PM
I've never had a need to use Autofac so I have no real comparison point. However looking at his tests I definitely saw no reason he dubbed Autofac top other than personal preference.