You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit bf6efe5
Browse filesBrowse the repository at this point in the historyBrowse files
Resolves an object graph that asks for the same dependency twice. Both requests inside one resolution share an instance, while the next resolution gets a new one.
Resolves scoped services inside explicit scopes. One instance per scope, different instances across scopes, and scope-owned disposables are disposed when the scope ends.
Resolves three roots that mix singleton and transient dependencies. The singleton is shared across every root while each transient dependency is distinct.
Resolves three roots that carry writable service properties. The container, or its intended property-injection extension, must assign them during activation.
Registers one open generic service mapping and resolves roots closed over int, float and object. Registering every closed type separately does not count.
Injects a sequence of five plugin implementations and requires it to be genuinely lazy: nothing is created until enumeration, and every enumeration yields new transients.
Gives each of three consumers a different implementation of one contract, chosen through the metadata, key, predicate or consumer-context mechanism of the library.
<summary><strong>13 · Interception With Proxy</strong></summary>
189
213
214
+
Resolves a service through the interception or activation extension point of the library. The result must be a proxy whose interceptor proceeds to the real target.
215
+
190
216

191
217
192
218
</details>
193
219
<details>
194
220
<summary><strong>14 · Prepare And Register</strong></summary>
195
221
222
+
Measures creating the container and registering the whole prescribed graph, without resolving anything from it.
223
+
196
224

197
225
198
226
</details>
199
227
<details>
200
228
<summary><strong>15 · Prepare And Register And Simple Resolve</strong></summary>
201
229
230
+
Measures the same setup as Prepare And Register, followed by a single resolve of one singleton root.
231
+
202
232

"description": "Registers three singleton services and resolves each of them repeatedly. Every resolve of the same service must return the same instance."
9
+
},
10
+
{
11
+
"id": "Transient",
12
+
"order": 2,
13
+
"name": "Transient",
14
+
"description": "Registers three transient services and resolves each of them repeatedly. Every resolve must create a new instance, never reusing an earlier one."
15
+
},
16
+
{
17
+
"id": "PerResolve",
18
+
"order": 3,
19
+
"name": "PerResolve",
20
+
"description": "Resolves an object graph that asks for the same dependency twice. Both requests inside one resolution share an instance, while the next resolution gets a new one."
21
+
},
22
+
{
23
+
"id": "Scoped",
24
+
"order": 4,
25
+
"name": "Scoped",
26
+
"description": "Resolves scoped services inside explicit scopes. One instance per scope, different instances across scopes, and scope-owned disposables are disposed when the scope ends."
27
+
},
28
+
{
29
+
"id": "Combined",
30
+
"order": 5,
31
+
"name": "Combined",
32
+
"description": "Resolves three roots that mix singleton and transient dependencies. The singleton is shared across every root while each transient dependency is distinct."
33
+
},
34
+
{
35
+
"id": "Complex",
36
+
"order": 6,
37
+
"name": "Complex",
38
+
"description": "Registers and resolves three multi-level object graphs, checking that every nested dependency has the expected implementation type and lifetime."
39
+
},
40
+
{
41
+
"id": "Property",
42
+
"order": 7,
43
+
"name": "Property",
44
+
"description": "Resolves three roots that carry writable service properties. The container, or its intended property-injection extension, must assign them during activation."
45
+
},
46
+
{
47
+
"id": "Generics",
48
+
"order": 8,
49
+
"name": "Generics",
50
+
"description": "Registers one open generic service mapping and resolves roots closed over int, float and object. Registering every closed type separately does not count."
51
+
},
52
+
{
53
+
"id": "Enumerable",
54
+
"order": 9,
55
+
"name": "IEnumerable",
56
+
"description": "Injects a sequence of five plugin implementations and requires it to be genuinely lazy: nothing is created until enumeration, and every enumeration yields new transients."
57
+
},
58
+
{
59
+
"id": "Array",
60
+
"order": 10,
61
+
"name": "Array",
62
+
"description": "Resolves three roots that materialise their injected sequence of five plugins into an array while the root is being activated."
63
+
},
64
+
{
65
+
"id": "Conditional",
66
+
"order": 11,
67
+
"name": "Conditional",
68
+
"description": "Gives each of three consumers a different implementation of one contract, chosen through the metadata, key, predicate or consumer-context mechanism of the library."
69
+
},
70
+
{
71
+
"id": "ChildContainer",
72
+
"order": 12,
73
+
"name": "Child Container",
74
+
"description": "Creates a real nested child container that inherits the registrations of its parent and can add or override them without changing the parent."
75
+
},
76
+
{
77
+
"id": "InterceptionWithProxy",
78
+
"order": 13,
79
+
"name": "Interception With Proxy",
80
+
"description": "Resolves a service through the interception or activation extension point of the library. The result must be a proxy whose interceptor proceeds to the real target."
81
+
},
82
+
{
83
+
"id": "PrepareAndRegister",
84
+
"order": 14,
85
+
"name": "Prepare And Register",
86
+
"description": "Measures creating the container and registering the whole prescribed graph, without resolving anything from it."
87
+
},
88
+
{
89
+
"id": "PrepareAndRegisterAndSimpleResolve",
90
+
"order": 15,
91
+
"name": "Prepare And Register And Simple Resolve",
92
+
"description": "Measures the same setup as Prepare And Register, followed by a single resolve of one singleton root."
"Resolves an object graph that asks for the same dependency twice. Both requests inside one resolution share an instance, while the next resolution gets a new one.")]
Copy file name to clipboardExpand all lines: src/Matrix.DependencyInjection/Benchmarks/Common/04_Scoped.cs
+5-1Lines changed: 5 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,11 @@
3
3
4
4
namespaceMatrix.DependencyInjection.Benchmarks;
5
5
6
-
[FeatureBenchmark(FeatureId.Scoped,4,"Scoped")]
6
+
[MatrixFeature(
7
+
nameof(FeatureId.Scoped),
8
+
4,
9
+
"Scoped",
10
+
"Resolves scoped services inside explicit scopes. One instance per scope, different instances across scopes, and scope-owned disposables are disposed when the scope ends.")]
0 commit comments