Performance comparison of .NET IoC containers
C#

README.md

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 3 minutes and result is extrapolated.

Basic Features

Container Singleton Transient Combined Complex
No 58
54
65
68
89
99
96
80
Autofac 4.2.1 975
697
1695
1072
4516
3622
13056
10724
Caliburn.Micro 1.5.2 470
281
552
343
1669
927
7434
4084
Catel 4.5.4 379
410
4316
5117
11198
11641
24795
27404
DryIoc 2.4.3 31
43
38
62
56
91
70
71
DryIocZero 2.1.0 79
65
77
70
80
95
188
140
Dynamo 3.0.2.0 97
72
100
84
211
152
635
368
fFastInjector 1.0.1 63
71
132
103
290
205
654
402
Funq 1.0.0.0 122
92
143
111
396
258
1066
631
Grace 4.0.2 179
134
328
240
789
487
2177
1278
Griffin 1.1.2 301
192
305
210
707
435
2004
1525
HaveBox 2.0.0 41
51
47
60
66
97
106
90
IfInjector 0.8.1 74
81
121
101
154
129
206
146
LightCore 1.5.1 184
196
2478
1349
25106
30593
160556
207181*
LightInject 5.0.0 41
45
56
60
75
81
90
100
LinFu 2.3.0.41559 3794
2406
19975
14511
51402
35572
122377
75771
Maestro 1.5.4 337
253
374
278
1094
643
3104
1747
Mef 4.0.0.0 22424
12124
35595
25034
59216
67576
118099
146429
Mef2 1.0.30.0 240
208
250
209
345
292
613
443
MicroSliver 2.1.6.0 215
271
881
776
2690
2317
8213
7327
Microsoft.Framework.DependencyInjection 1.0.0-beta8 197
217
191
126
387
448
1044
1133
Mugen 3.5.1 498
563
822
968
2255
2745
7666
9388
Munq 3.1.6 119
98
161
148
669
467
1992
1319
Ninject 3.2.2.0 5224
3437
16579
11961
46445
30800
136712
85362
Petite 0.3.2 4118
2690
4161
2763
4477
2584
4966
2670
SimpleInjector 3.3.2 63
80
120
86
150
121
151
132
Spring.NET 2.0.1 976
978
10185
11925
27810
24892
73589
58129
Stashbox 1.0.132 99
84
166
129
230
166
246
181
StructureMap 4.4.2 1290
950
1312
833
3708
2292
8881
5411
StyleMVVM 3.1.5 437
266
485
303
721
451
1513
864
TinyIoC 1.3 455
467
1576
1051
7081
5117
29000
20842
Unity 4.0.1 2531
1406
3857
2088
10225
5657
28572
16225
Windsor 3.3.0 475
327
1855
1062
6026
3346
18122
9722

Advanced Features

Container Property Generics IEnumerable Conditional Child Container Interception With Proxy
No 115
98
71
69
177
135
71
63
613
367
70
63
Autofac 4.2.1 27090
17339
3431
2361
13288
8282

50111
30490
24040
13034
Caliburn.Micro 1.5.2 9578
5126

6207
3466



Catel 4.5.4
10712
11508



4433
4715
DryIoc 2.4.3 95
97
55
75
264
189
53
66

816
498
DryIocZero 2.1.0 211
156

309
210
70
84


Dynamo 3.0.2.0 786
464





fFastInjector 1.0.1





Funq 1.0.0.0 1153
641





Grace 4.0.2 2358
1339
774
496
2665
1440
804
491
10364
5939
5928
3177
Griffin 1.1.2





HaveBox 2.0.0 815
447

1784
993


720
417
IfInjector 0.8.1 391
252
146
127




LightCore 1.5.1 2490
2259
17591
17980
40054
31362



LightInject 5.0.0 105
146
88
78
369
329
659
472

1538
871
LinFu 2.3.0.41559





Maestro 1.5.4 3403
1863
714
480
3150
1763
930
586

5763
3138
Mef 4.0.0.0 124601
138121
147178
139065
104933
130921



Mef2 1.0.30.0 1313
1022
315
248
1617
1116



MicroSliver 2.1.6.0





Microsoft.Framework.DependencyInjection 1.0.0-beta8
253
211
932
655



Mugen 3.5.1 10420
9159
71665
79952
6639
8367
1841
2230
580141
542910
20313
24812
Munq 3.1.6 1683
1155





Ninject 3.2.2.0 126340
94262
51421
34619
116662
86730
39381
28760
75048000
53320497
27366
21004
Petite 0.3.2 6076
3382





SimpleInjector 3.3.2 295
160
89
88
805
463
72
79

7113
3998
Spring.NET 2.0.1 56159
53415




53353
55179
Stashbox 1.0.132 437
284
188
160
502
316
189
148
226897*
133160

StructureMap 4.4.2 9927
5526
2475
1489
7564
4405

3340111
1802940
7888
4710
StyleMVVM 3.1.5 1713
979
1269
699
3082
1725
1329
743


TinyIoC 1.3 4712
4934



12401
7236

Unity 4.0.1 29090
17028

45898
23941

34469
21442
93685
49400
Windsor 3.3.0 34678
18895
14956
7996
16662
9241

225855*
Error
13791
7336

Prepare

Container Prepare And Register Prepare And Register And Simple Resolve
No 2
3
Autofac 4.2.1 293
326
Caliburn.Micro 1.5.2 53
59
Catel 4.5.4 8804
8968
DryIoc 2.4.3 79
420
DryIocZero 2.1.0 0
0
Dynamo 3.0.2.0 14896
15395
fFastInjector 1.0.1 6142
6037
Funq 1.0.0.0 7
8
Grace 4.0.2 1116
2814
Griffin 1.1.2 7545
8020
HaveBox 2.0.0 54181
54777
IfInjector 0.8.1 1509
2001
LightCore 1.5.1 228
230
LightInject 5.0.0 145
653
LinFu 2.3.0.41559 99
337
Maestro 1.5.4 173
677
Mef 4.0.0.0 14
2320
Mef2 1.0.30.0 6024
7467
MicroSliver 2.1.6.0 11
16
Microsoft.Framework.DependencyInjection 1.0.0-beta8 29
31
Mugen 3.5.1 508
2066
Munq 3.1.6 9945
9547
Ninject 3.2.2.0 142265
139074
Petite 0.3.2 37
47
SimpleInjector 3.3.2 377
2935
Spring.NET 2.0.1 27593
27718
Stashbox 1.0.132 969
1476
StructureMap 4.4.2 1375
7375
StyleMVVM 3.1.5 71837
78801
TinyIoC 1.3 58
71
Unity 4.0.1 638
2254
Windsor 3.3.0 3027
3141

Charts

Basic features Advanced features Prepare

Machine

The benchmark was executed on the following machine:
CPU: Intel(R) Core(TM) i5-6260U CPU @ 1.80GHz
Memory: 15,89GB