/IocPerformance

Performance comparison of .NET IoC containers

Primary LanguageC#Apache License 2.0Apache-2.0

Ioc Performance

Build Status

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

Container Singleton Transient Combined Complex
No 41
49
49
59
69
76
99
103
abioc 0.8.0 26
43
33
56
51
82
67
78
Autofac 4.9.4 593
389
754
504
1953
1191
5877
3609
Caliburn.Micro 1.5.2 465
270
533
322
1583
906
7403
3712
Catel 5.11.2 262
308
4283
4695
9693
10646
22248
24653
DryIoc 4.0.7 36
49
56
79
57
102
76
89
DryIocZero 4.0.0 110
96
88
89
98
105
220
169
Dynamo 3.0.2 95
70
104
86
207
158
685
381
Grace 7.1.0 26
42
36
62
55
83
67
83
Lamar 3.1.0 58
68
70
103
99
121
119
138
LightInject 6.2.0 30
47
37
66
56
89
78
88
Maestro 3.6.2 365
254
302
211
540
390
1493
979
Mef 4.0.0.0 22679
11820
37640
25052
57462
68730*
112712*
131716*
Mef2 1.0.33.0 294
226
294
206
357
252
677
462
MicroResolver 2.3.5 25
39
34
59
55
77
92
89
Microsoft Extensions DependencyInjection 3.0.0 85
84
108
101
128
124
143
129
Microsoft.VisualStudio.Composition 16.4.11 9074
4916
13891
9399
19760
14962
57910
51972
Mugen MVVM Toolkit 6.5.0 102
138
409
715
2052
2590
9348
11352
MvvmCross 6.4.1 254
288
1326
1426
3440
3721
10322
9997
Ninject 3.3.4 3473
2563
8686
6969
23529
17635
63579*
49285
Rezolver 2.0.0 91
98
120
93
174
147
303
231
SimpleInjector 4.7.1 80
77
96
93
128
121
169
144
Singularity 0.14.0 24
45
38
61
50
88
65
82
Spring.NET 2.0.1 950
987
9711
11447
26941
23873
74745*
57777
Stashbox 2.8.5 39
55
46
68
65
92
90
112
StructureMap 4.7.1 1121
717
1281
856
3410
2166
8312
6052
Unity 5.11.1 231
160
1598
926
3599
1995
8365
4647
Windsor 5.0.1 454
342
1796
1092
5618
3523
16853
10289
Zenject 8.0.0 479
448
1370
1070
3689
3065
11142
10106

Advanced Features

Container Property Generics IEnumerable Conditional Child Container Asp Net Core Interception With Proxy
No 186
134
70
75
193
176
53
63
644
596

469
438
abioc 0.8.0

799
506




Autofac 4.9.4 6070
3626
2243
1377
7838
4615
1445
901
84497*
53089
35800
21902
22852
14654
Caliburn.Micro 1.5.2 9157
4733

5965
3393




Catel 5.11.2
9585
10434




4295
4634
DryIoc 4.0.7 122
123
58
83
326
232
58
78

1842
1358
838
540
DryIocZero 4.0.0 294
205
92
92
302
229
380
270



Dynamo 3.0.2 828
455






Grace 7.1.0 104
116
49
87
291
215
47
70
54478
32637
868
680
1151
689
Lamar 3.1.0 74
89
86
127
555
410


1623
1581

LightInject 6.2.0 116
122
53
77
300
225
350
252

2291
1627
1496
923
Maestro 3.6.2 3200
2005
385
286
1303
837


8309
5461
5776
3311
Mef 4.0.0.0 124500*
133833*
137086*
114221*
97231*
100896*




Mef2 1.0.33.0 1360
881
294
212
1368
839




MicroResolver 2.3.5 39
62

262
195




Microsoft Extensions DependencyInjection 3.0.0
124
114
361
265


3020
1967

Microsoft.VisualStudio.Composition 16.4.11 44285
31830

42023
35658




Mugen MVVM Toolkit 6.5.0 436
705

9749
7094

4370
3103


MvvmCross 6.4.1 1338
1437
7389
8213


5302
3460


Ninject 3.3.4 62765*
47908
24256
15895
64193*
49074
19294
12954
73303000*
50234113*

20215
15029
Rezolver 2.0.0 454
360
139
156
490
354

6570200*
4095208*
59211
33867

SimpleInjector 4.7.1 255
246
123
111
1390
838
78
79


7219
4205
Singularity 0.14.0
49
75
292
220


507
555

Spring.NET 2.0.1 52419
51992





43647
43419
Stashbox 2.8.5 142
140
67
90
358
336
65
85
203135*
120429*
1700
1611
840
543
StructureMap 4.7.1 8697
5284
2271
1460
8399
5170

3215578*
1887211*
65269*
41725
7859
4464
Unity 5.11.1 8560
4885
9191
5255
15421
8702
3319
1861
119255*
70861*
54284
39245
50324
27704
Windsor 5.0.1 34532
19632
15140
9111
15426
9609

226334*
120937*

13105
7493
Zenject 8.0.0 15829
13135
9021
6513
17932
12687
3082
2428
22250
18595


Prepare

Container Prepare And Register Prepare And Register And Simple Resolve
No 2
2
abioc 0.8.0 6327
6556
Autofac 4.9.4 361
410
Caliburn.Micro 1.5.2 55
56
Catel 5.11.2 100278*
100744*
DryIoc 4.0.7 76
83
DryIocZero 4.0.0 0
1
Dynamo 3.0.2 16240
16527
Grace 7.1.0 213
1128
Lamar 3.1.0 1986
2373
LightInject 6.2.0 114
821
Maestro 3.6.2 141
148
Mef 4.0.0.0 17
2299
Mef2 1.0.33.0 5313
6601
MicroResolver 2.3.5 27322
67518
Microsoft Extensions DependencyInjection 3.0.0 23
32
Microsoft.VisualStudio.Composition 16.4.11 7904
8540
Mugen MVVM Toolkit 6.5.0 15
19
MvvmCross 6.4.1 10
16
Ninject 3.3.4 130706*
126470*
Rezolver 2.0.0 12625
18413
SimpleInjector 4.7.1 674
3185
Singularity 0.14.0 27
443
Spring.NET 2.0.1 25014
24884
Stashbox 2.8.5 72
301
StructureMap 4.7.1 1325
7389
Unity 5.11.1 113
299
Windsor 5.0.1 2912
2934
Zenject 8.0.0 199
201

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