Commit 7eab8ed 1 parent 70de9b2 commit 7eab8ed Copy full SHA for 7eab8ed
File tree 2 files changed +10
-13
lines changed
Autofac.Specification.Test/Registration
Autofac.Test/Features/OpenGenerics
2 files changed +10
-13
lines changed Original file line number Diff line number Diff line change
1
+ using System . Diagnostics ;
2
+ using System . Globalization ;
3
+ using Xunit ;
4
+ using Xunit . Abstractions ;
5
+
1
6
namespace Autofac . Specification . Test . Registration
2
7
{
3
- using System . Diagnostics ;
4
- using Xunit ;
5
- using Xunit . Abstractions ;
6
-
7
8
public class AssemblyScanningPerformanceTests
8
9
{
9
- private readonly ITestOutputHelper output ;
10
+ private readonly ITestOutputHelper _output ;
10
11
11
- public AssemblyScanningPerformanceTests ( ITestOutputHelper output )
12
- {
13
- this . output = output ;
14
- }
12
+ public AssemblyScanningPerformanceTests ( ITestOutputHelper output ) => _output = output ;
15
13
16
14
[ Fact ]
17
15
public void MeasurePerformance ( )
18
16
{
19
17
var builder = new ContainerBuilder ( ) ;
20
18
for ( var i = 0 ; i < 1000 ; i ++ )
21
19
{
22
- //just to simulate a lot of "scanning" with few (in this case zero) "hits"
20
+ // Just to simulate a lot of "scanning" with few (in this case zero) "hits"
23
21
builder . RegisterAssemblyTypes ( GetType ( ) . Assembly ) . Where ( x => false ) ;
24
22
}
25
23
26
24
var stopwatch = Stopwatch . StartNew ( ) ;
27
25
builder . Build ( ) . Dispose ( ) ;
28
26
29
- //after fix drops from ~500ms to ~100ms
30
- output . WriteLine ( stopwatch . Elapsed . TotalMilliseconds . ToString ( ) ) ;
27
+ // After fix drops from ~500ms to ~100ms
28
+ _output . WriteLine ( stopwatch . Elapsed . TotalMilliseconds . ToString ( CultureInfo . InvariantCulture ) ) ;
31
29
}
32
30
}
33
31
}
Original file line number Diff line number Diff line change @@ -341,7 +341,6 @@ public void ResolveTypeFromOpenGenericInterfaceTypeParameterIsInterfaceWithConst
341
341
var instance = container . Resolve < INested < ISimpleInterface > > ( ) ;
342
342
}
343
343
344
-
345
344
private class CNestedSimpleInterface : INested < ISimpleInterface >
346
345
{
347
346
}
You can’t perform that action at this time.
0 commit comments