Ioc Performance

July 20, 2023 ยท View on GitHub

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

ContainerSingletonTransientCombinedComplex
No41
49
49
59
69
76
99
103
abioc 0.8.026
43
33
56
51
82
67
78
Autofac 7.0.11010
590
969
659
3118
1917
8470
5543
Caliburn.Micro 1.5.2465
270
533
322
1583
906
7403
3712
Catel 5.12.22250
296
3979
4314
8954
9876
25104
23025
DryIoc 4.8.563
54
73
73
89
100
110
101
DryIocZero 4.0.0110
96
88
89
98
105
220
169
Dynamo 3.0.295
70
104
86
207
158
685
381
Faster.Ioc 1.0.025
46
72
62
67
82
139
93
Grace 7.2.120
31
39
55
52
84
73
83
Lamar 8.0.161
63
86
83
117
110
130
127
LightInject 6.6.451
52
62
59
113
102
230
195
Maestro 3.6.6386
269
342
241
580
438
1411
1097
Mef 4.0.0.022679
11820
37640
25052
57462
68730*
112712*
131716*
Mef2 7.0.0.0298
235
327
176
327
248
621
410
MicroResolver 2.3.525
39
34
59
55
77
92
89
Microsoft Extensions DependencyInjection 7.0.068
58
96
79
110
106
131
112
Microsoft.VisualStudio.Composition 17.6.1710905
12502
33562
21704
66196*
25605
60406*
55918
Mugen MVVM Toolkit 6.5.0102
138
409
715
2052
2590
9348
11352
MvvmCross 8.0.2205
251
1318
1402
3316
3726
8677
9516
Ninject 3.3.63809
4583
13588
11986
37822
28199
105486*
79549*
Pure.DI 2.0.029
33
40
62
61
88
105
104
Rezolver 2.1.0121
100
137
126
194
171
328
238
SimpleInjector 5.4.187
67
71
91
152
129
233
179
Singularity 0.18.024
39
39
59
66
82
76
84
Spring.NET 3.0.2565
451
3022
1649
9816
6870
28453
21414
Stashbox 5.11.040
47
57
69
78
94
127
111
StructureMap 4.7.11121
717
1281
856
3410
2166
8312
6052
Unity 5.11.10216
148
1443
835
3326
1995
9503
4739
Windsor 6.0.0549
533
2065
1168
6572
5948
20046
18318
ZenIoc 1.0.1306
198
267
188
674
440
1809
1103
Zenject 8.0.0479
448
1370
1070
3689
3065
11142
10106

Advanced Features

ContainerPropertyGenericsIEnumerableConditionalChild ContainerAsp Net CoreInterception With Proxy
No186
134
70
75
193
176
53
63
644
596

469
438
abioc 0.8.0

799
506




Autofac 7.0.19031
5468
2319
1330
11000
6339
2085
1423
74767*
57993
44266
37346
24279
13732
Caliburn.Micro 1.5.29157
4733

5965
3393




Catel 5.12.22
8872
9710




3937
4257
DryIoc 4.8.5144
131
86
88
294
219
81
79

1379
1005
835
555
DryIocZero 4.0.0294
205
92
92
302
229
380
270



Dynamo 3.0.2828
455






Faster.Ioc 1.0.0
95
87
388
287
107
66

797
635

Grace 7.2.1101
112
50
80
257
210
45
70
50375
32231
657
674
827
571
Lamar 8.0.1133
98
106
108
634
432


4753
4323

LightInject 6.6.4259
142
53
69
309
280
494
273

2098
1711
1921
1005
Maestro 3.6.63886
2438
419
318
1272
843


10764
8560
6757
3630
Mef 4.0.0.0124500*
133833*
137086*
114221*
97231*
100896*




Mef2 7.0.0.01337
921
273
195
1851
813




MicroResolver 2.3.539
62

262
195




Microsoft Extensions DependencyInjection 7.0.0
117
94
363
242


4263
2412

Microsoft.VisualStudio.Composition 17.6.1747046
34542

45837
38733




Mugen MVVM Toolkit 6.5.0436
705

9749
7094

4370
3103


MvvmCross 8.0.21310
1415
6576
7299


4968
3230


Ninject 3.3.678292*
60394*
28241
20249
92792*
68004*
24794
18311
78784000*
45766768*

22231
19065
Pure.DI 2.0.075
63
86
78
328
272
85
71


249
192
Rezolver 2.1.0520
385
183
145
669
408

9589857*
5697265*
86587*
56374

SimpleInjector 5.4.1366
204
99
103
755
738
85
83


5503
4220
Singularity 0.18.0
54
80
241
193


631
652

Spring.NET 3.0.221087
16280





21268
15259
Stashbox 5.11.0148
181
108
97
542
509
74
83
871072*
663243*
2098
1280
917
643
StructureMap 4.7.18697
5284
2271
1460
8399
5170

3215578*
1887211*
65269*
41725
7859
4464
Unity 5.11.109045
5814
9842
6443
17755
12048
3547
2046
147355*
74313*
61350*
39009
56226
31096
Windsor 6.0.038349
32062
16588
12021
17909
14575

252113*
175868*

16722
11052
ZenIoc 1.0.1264
195
276
209
704
488
314
222
602490*
471765*


Zenject 8.0.015829
13135
9021
6513
17932
12687
3082
2428
22250
18595


Prepare

ContainerPrepare And RegisterPrepare And Register And Simple Resolve
No2
2
abioc 0.8.06327
6556
Autofac 7.0.1359
367
Caliburn.Micro 1.5.255
56
Catel 5.12.2211925
9956
DryIoc 4.8.556
64
DryIocZero 4.0.00
1
Dynamo 3.0.216240
16527
Faster.Ioc 1.0.051
1283
Grace 7.2.1157
966
Lamar 8.0.12516
3044
LightInject 6.6.4127
2146
Maestro 3.6.6128
144
Mef 4.0.0.017
2299
Mef2 7.0.0.06114
6957
MicroResolver 2.3.527322
67518
Microsoft Extensions DependencyInjection 7.0.022
35
Microsoft.VisualStudio.Composition 17.6.179311
11123
Mugen MVVM Toolkit 6.5.015
19
MvvmCross 8.0.210
16
Ninject 3.3.6134240*
112279*
Pure.DI 2.0.00

Rezolver 2.1.020835
27706
SimpleInjector 5.4.1825
3214
Singularity 0.18.0314
874
Spring.NET 3.0.215929
17596
Stashbox 5.11.0202
1113
StructureMap 4.7.11325
7389
Unity 5.11.10122
287
Windsor 6.0.03927
2927
ZenIoc 1.0.177
964
Zenject 8.0.0199
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