Skip to content
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 3.5.2 713
525
1650
1016
4515
3206
12625
10193
Caliburn.Micro 1.5.2 470
281
552
343
1669
927
7434
4084
Catel 4.4.0 323
356
3855
4121
9381
10105
23480
23799
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 3.1.2 157
115
308
207
786
455
2260
1213
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 4.0.10-rc2-2 44
47
47
59
69
88
82
93
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.1.5 59
55
92
74
118
110
147
114
Spring.NET 2.0.1 976
978
10185
11925
27810
24892
73589
58129
Stashbox 1.0.104.0 112
102
195
158
228
199
291
243
StructureMap 4.2.0.402 1413
1207
1546
1096
4181
2968
10955
7435
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 3.5.2 25023
17237
3568
2282
11017
7756

67261
37960
27306
14319
Caliburn.Micro 1.5.2 9578
5126

6207
3466



Catel 4.4.0
9216
9945



3762
4090
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 3.1.2 2285
1288
762
439
2471
1306
768
452
10135
5662
5315
2977
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 4.0.10-rc2-2 101
110
74
70
365
275
554
414

1478
1076
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.1.5 214
157
73
83
799
446
71
72

1046
620
Spring.NET 2.0.1 56159
53415




53353
55179
Stashbox 1.0.104.0 499
384
239
191
565
452
225
186
8751
6023

StructureMap 4.2.0.402 10857
7345
2789
1904
8721
5663

3555039
1896903
7414
4064
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 3.5.2 322
377
Caliburn.Micro 1.5.2 53
59
Catel 4.4.0 8495
8863
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 3.1.2 1186
2660
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 4.0.10-rc2-2 150
685
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.1.5 400
1277
Spring.NET 2.0.1 27593
27718
Stashbox 1.0.104.0 1144
1728
StructureMap 4.2.0.402 1320
7638
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

Something went wrong with that request. Please try again.