Evidence-based feature and performance comparisons for .NET libraries.
A gold, silver and bronze star for the first three places of every benchmark overview.
| # | Library | 🥇 | 🥈 | 🥉 | Won |
|---|---|---|---|---|---|
| 1 | Pure.DI | 3 | gold in Advanced, gold in Basic, gold in Prepare | ||
| 2 | Grace | 2 | silver in Advanced, silver in Basic | ||
| 3 | MvvmCross | 1 | silver in Prepare | ||
| 4 | DryIoc | 1 | bronze in Prepare | ||
| 5 | Singularity | 1 | bronze in Basic | ||
| 6 | Stashbox | 1 | bronze in Advanced |
Performance and allocated memory are shown together. Lower values are better.
| Autofac 9.3.1 A flexible inversion of control container for building extensible .NET applications. |
|
| Castle Windsor 6.0.0 The Castle Project container, with bound lifestyles and Castle DynamicProxy interception. |
|
| Catel 6.2.0 An MVVM application framework whose service locator and type factory perform constructor injection. |
|
| DryIoc 5.4.3 A fast, small and feature-rich container with expression-compiled resolution and rich reuse options. |
|
| Faster.Ioc 5.0.0 A minimalistic container focused on the shortest possible resolve path. |
|
| Grace 7.2.1 A container with a fluent registration model, per-object-graph lifestyles and decorator support. |
|
| Lamar 16.0.0 The successor to StructureMap, built around runtime code generation. |
|
| LightInject 7.1.0 A lightweight container with an ultra-small API surface and its own interception package. |
|
| Maestro 3.6.6 A small container with a fluent configuration API and pluggable activation interceptors. |
|
| Managed Extensibility Framework 2 10.0.10 The lightweight Managed Extensibility Framework composition engine shipped as System.Composition. |
|
| Microsoft Extensions Dependency Injection 10.0.10 The built-in .NET dependency injection container and its service collection abstractions. |
|
| MvvmCross 10.1.2 A cross-platform MVVM framework with its own inversion of control provider. |
|
| Ninject 3.3.6 A container built around fluent bindings, contextual conditions and pluggable extensions. |
|
| Pure.DI 2.5.2 A compile-time dependency injection framework that generates strongly typed compositions. |
|
| Simple Injector 5.6.0 A fast, opinionated dependency injection library that promotes explicit configuration and maintainable application design. |
|
| Singularity 0.18.0 An expression-tree based container that validates the whole object graph when the container is built. |
|
| Spring.NET 3.0.3 The Spring.NET application framework and its XML or code configured object factory. |
|
| Stashbox 5.20.0 A fast container with per-request lifetimes, conditional registrations and child containers. |
|
| StructureMap 4.7.1 A mature container with a fluent registry DSL, nested containers and decorators. |
|
| Unity 5.11.10 The Unity container, offering per-resolve lifetimes and hierarchical child containers. |
|
| Visual Studio MEF 17.13.41 The Visual Studio composition engine, a fast attribute-driven MEF implementation. |
|
| ZenIoc 1.0.1 A tiny container with compiled registrations, named resolution and nested containers. |
01 · Singleton
Registers three singleton services and resolves each of them repeatedly. Every resolve of the same service must return the same instance.
02 · Transient
Registers three transient services and resolves each of them repeatedly. Every resolve must create a new instance, never reusing an earlier one.
03 · PerResolve
Resolves an object graph that asks for the same dependency twice. Both requests inside one resolution share an instance, while the next resolution gets a new one.
04 · Scoped
Resolves scoped services inside explicit scopes. One instance per scope, different instances across scopes, and scope-owned disposables are disposed when the scope ends.
05 · Combined
Resolves three roots that mix singleton and transient dependencies. The singleton is shared across every root while each transient dependency is distinct.
06 · Complex
Registers and resolves three multi-level object graphs, checking that every nested dependency has the expected implementation type and lifetime.
07 · Property
Resolves three roots that carry writable service properties. The container, or its intended property-injection extension, must assign them during activation.
08 · Generics
Registers one open generic service mapping and resolves roots closed over int, float and object. Registering every closed type separately does not count.
09 · IEnumerable
Injects a sequence of five plugin implementations and requires it to be genuinely lazy: nothing is created until enumeration, and every enumeration yields new transients.
10 · Array
Resolves three roots that materialise their injected sequence of five plugins into an array while the root is being activated.
11 · Conditional
Gives each of three consumers a different implementation of one contract, chosen through the metadata, key, predicate or consumer-context mechanism of the library.
12 · Child Container
Creates a real nested child container that inherits the registrations of its parent and can add or override them without changing the parent.
13 · Interception With Proxy
Resolves a service through the interception or activation extension point of the library. The result must be a proxy whose interceptor proceeds to the real target.
14 · Prepare And Register
Measures creating the container and registering the whole prescribed graph, without resolving anything from it.

















