Skip to content
This repository has been archived by the owner on Jul 20, 2023. It is now read-only.

danielpalme/IocPerformance

Repository files navigation

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 7.0.1 1010
590
969
659
3118
1917
8470
5543
Caliburn.Micro 1.5.2 465
270
533
322
1583
906
7403
3712
Catel 5.12.22 250
296
3979
4314
8954
9876
25104
23025
DryIoc 4.8.5 63
54
73
73
89
100
110
101
DryIocZero 4.0.0 110
96
88
89
98
105
220
169
Dynamo 3.0.2 95
70
104
86
207
158
685
381
Faster.Ioc 1.0.0 25
46
72
62
67
82
139
93
Grace 7.2.1 20
31
39
55
52
84
73
83
Lamar 8.0.1 61
63
86
83
117
110
130
127
LightInject 6.6.4 51
52
62
59
113
102
230
195
Maestro 3.6.6 386
269
342
241
580
438
1411
1097
Mef 4.0.0.0 22679
11820
37640
25052
57462
68730*
112712*
131716*
Mef2 7.0.0.0 298
235
327
176
327
248
621
410
MicroResolver 2.3.5 25
39
34
59
55
77
92
89
Microsoft Extensions DependencyInjection 7.0.0 68
58
96
79
110
106
131
112
Microsoft.VisualStudio.Composition 17.6.17 10905
12502
33562
21704
66196*
25605
60406*
55918
Mugen MVVM Toolkit 6.5.0 102
138
409
715
2052
2590
9348
11352
MvvmCross 8.0.2 205
251
1318
1402
3316
3726
8677
9516
Ninject 3.3.6 3809
4583
13588
11986
37822
28199
105486*
79549*
Pure.DI 2.0.0 29
33
40
62
61
88
105
104
Rezolver 2.1.0 121
100
137
126
194
171
328
238
SimpleInjector 5.4.1 87
67
71
91
152
129
233
179
Singularity 0.18.0 24
39
39
59
66
82
76
84
Spring.NET 3.0.2 565
451
3022
1649
9816
6870
28453
21414
Stashbox 5.11.0 40
47
57
69
78
94
127
111
StructureMap 4.7.1 1121
717
1281
856
3410
2166
8312
6052
Unity 5.11.10 216
148
1443
835
3326
1995
9503
4739
Windsor 6.0.0 549
533
2065
1168
6572
5948
20046
18318
ZenIoc 1.0.1 306
198
267
188
674
440
1809
1103
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 7.0.1 9031
5468
2319
1330
11000
6339
2085
1423
74767*
57993
44266
37346
24279
13732
Caliburn.Micro 1.5.2 9157
4733

5965
3393




Catel 5.12.22
8872
9710




3937
4257
DryIoc 4.8.5 144
131
86
88
294
219
81
79

1379
1005
835
555
DryIocZero 4.0.0 294
205
92
92
302
229
380
270



Dynamo 3.0.2 828
455






Faster.Ioc 1.0.0
95
87
388
287
107
66

797
635

Grace 7.2.1 101
112
50
80
257
210
45
70
50375
32231
657
674
827
571
Lamar 8.0.1 133
98
106
108
634
432


4753
4323

LightInject 6.6.4 259
142
53
69
309
280
494
273

2098
1711
1921
1005
Maestro 3.6.6 3886
2438
419
318
1272
843


10764
8560
6757
3630
Mef 4.0.0.0 124500*
133833*
137086*
114221*
97231*
100896*




Mef2 7.0.0.0 1337
921
273
195
1851
813




MicroResolver 2.3.5 39
62

262
195




Microsoft Extensions DependencyInjection 7.0.0
117
94
363
242


4263
2412

Microsoft.VisualStudio.Composition 17.6.17 47046
34542

45837
38733




Mugen MVVM Toolkit 6.5.0 436
705

9749
7094

4370
3103


MvvmCross 8.0.2 1310
1415
6576
7299


4968
3230


Ninject 3.3.6 78292*
60394*
28241
20249
92792*
68004*
24794
18311
78784000*
45766768*

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


249
192
Rezolver 2.1.0 520
385
183
145
669
408

9589857*
5697265*
86587*
56374

SimpleInjector 5.4.1 366
204
99
103
755
738
85
83


5503
4220
Singularity 0.18.0
54
80
241
193


631
652

Spring.NET 3.0.2 21087
16280





21268
15259
Stashbox 5.11.0 148
181
108
97
542
509
74
83
871072*
663243*
2098
1280
917
643
StructureMap 4.7.1 8697
5284
2271
1460
8399
5170

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

252113*
175868*

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


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 7.0.1 359
367
Caliburn.Micro 1.5.2 55
56
Catel 5.12.22 11925
9956
DryIoc 4.8.5 56
64
DryIocZero 4.0.0 0
1
Dynamo 3.0.2 16240
16527
Faster.Ioc 1.0.0 51
1283
Grace 7.2.1 157
966
Lamar 8.0.1 2516
3044
LightInject 6.6.4 127
2146
Maestro 3.6.6 128
144
Mef 4.0.0.0 17
2299
Mef2 7.0.0.0 6114
6957
MicroResolver 2.3.5 27322
67518
Microsoft Extensions DependencyInjection 7.0.0 22
35
Microsoft.VisualStudio.Composition 17.6.17 9311
11123
Mugen MVVM Toolkit 6.5.0 15
19
MvvmCross 8.0.2 10
16
Ninject 3.3.6 134240*
112279*
Pure.DI 2.0.0 0

Rezolver 2.1.0 20835
27706
SimpleInjector 5.4.1 825
3214
Singularity 0.18.0 314
874
Spring.NET 3.0.2 15929
17596
Stashbox 5.11.0 202
1113
StructureMap 4.7.1 1325
7389
Unity 5.11.10 122
287
Windsor 6.0.0 3927
2927
ZenIoc 1.0.1 77
964
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