-
-
Notifications
You must be signed in to change notification settings - Fork 120
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #500 from seesharper/flow-scope
Flow the scope when possible
- Loading branch information
Showing
39 changed files
with
1,268 additions
and
4,052 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,17 @@ | ||
{ | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Script Debug", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"program": "dotnet", | ||
"args": [ | ||
"exec", | ||
"/Users/bernhardrichter/.dotnet/tools/.store/dotnet-script/0.28.0/dotnet-script/0.28.0/tools/netcoreapp2.1/any/dotnet-script.dll" | ||
"${file}" | ||
], | ||
"cwd": "${workspaceRoot}", | ||
"stopAtEntry": true | ||
} | ||
] | ||
"version": "0.2.0", | ||
"configurations": [ | ||
{ | ||
"name": ".NET Script Debug", | ||
"type": "coreclr", | ||
"request": "launch", | ||
"program": "${env:HOME}/.dotnet/tools/dotnet-script", | ||
"args": ["${file}"], | ||
"windows": { | ||
"program": "${env:USERPROFILE}/.dotnet/tools/dotnet-script.exe", | ||
}, | ||
"cwd": "${workspaceFolder}", | ||
"stopAtEntry": true, | ||
} | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"Inheritdoc": { | ||
"prefix": "idoc", | ||
"body": ["/// <inheritdoc/>"], | ||
"description": "Inheritdoc" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,17 @@ | ||
{ | ||
"coverage-gutters.lcovname": "./CoverageResult/coverage.info", | ||
"coverage-gutters.xmlname": "./CoverageResult/coverage.opencover.xml", | ||
"dotnet-test-explorer.testArguments": "-c release -f netcoreapp2.0", | ||
"dotnet-test-explorer.showCodeLens": true | ||
} | ||
"coverage-gutters.lcovname": "./CoverageResult/coverage.info", | ||
"coverage-gutters.xmlname": "./CoverageResult/coverage.opencover.xml", | ||
"omnisharp.path": "latest", | ||
"cSpell.words": [ | ||
"Callvirt", | ||
"Conv", | ||
"Ldarg", | ||
"Ldelem", | ||
"Ldlen", | ||
"Ldloc", | ||
"Ldstr", | ||
"MSIL", | ||
"Stloc", | ||
"Xunit" | ||
] | ||
} |
302 changes: 0 additions & 302 deletions
302
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190806-105637.log
This file was deleted.
Oops, something went wrong.
342 changes: 0 additions & 342 deletions
342
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190806-105919.log
This file was deleted.
Oops, something went wrong.
303 changes: 0 additions & 303 deletions
303
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190806-110145.log
This file was deleted.
Oops, something went wrong.
363 changes: 0 additions & 363 deletions
363
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190807-112229.log
This file was deleted.
Oops, something went wrong.
310 changes: 0 additions & 310 deletions
310
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190807-113229.log
This file was deleted.
Oops, something went wrong.
317 changes: 0 additions & 317 deletions
317
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190807-113415.log
This file was deleted.
Oops, something went wrong.
303 changes: 0 additions & 303 deletions
303
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190807-113546.log
This file was deleted.
Oops, something went wrong.
5 changes: 0 additions & 5 deletions
5
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190808-013903.log
This file was deleted.
Oops, something went wrong.
309 changes: 0 additions & 309 deletions
309
...LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-20190811-103714.log
This file was deleted.
Oops, something went wrong.
14 changes: 0 additions & 14 deletions
14
...ject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-report-github.md
This file was deleted.
Oops, something went wrong.
3 changes: 0 additions & 3 deletions
3
.../results/LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-report.csv
This file was deleted.
Oops, something went wrong.
31 changes: 0 additions & 31 deletions
31
...results/LightInject.Microsoft.DependencyInjection.Benchmarks.PerformanceTests-report.html
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
using System; | ||
using BenchmarkDotNet.Attributes; | ||
using Microsoft.Extensions.DependencyInjection; | ||
using SimpleInjector; | ||
using SimpleInjector.Lifestyles; | ||
|
||
namespace LightInject.BenchMarks | ||
{ | ||
[MemoryDiagnoser] | ||
public class ScopeBenchmarks | ||
{ | ||
private IServiceScope microsoftScope; | ||
|
||
private IServiceContainer serviceContainer; | ||
|
||
private IServiceFactory lightInjectScope; | ||
|
||
private SimpleInjector.Scope simpleInjectorScope; | ||
|
||
|
||
[GlobalSetup] | ||
public void Setup() | ||
{ | ||
var serviceCollection = new ServiceCollection(); | ||
serviceCollection.AddTransient<Foo>(); | ||
|
||
serviceContainer = new ServiceContainer(); | ||
serviceContainer.Register<Foo>(); | ||
|
||
lightInjectScope = serviceContainer.BeginScope(); | ||
|
||
var microsoftServiceProvider = serviceCollection.BuildServiceProvider(); | ||
microsoftScope = microsoftServiceProvider.CreateScope(); | ||
|
||
|
||
var simpleInjectorContainer = new Container(); | ||
simpleInjectorContainer.Options.DefaultScopedLifestyle = new AsyncScopedLifestyle(); | ||
|
||
|
||
simpleInjectorContainer.Register<Foo>(Lifestyle.Scoped); | ||
simpleInjectorScope = AsyncScopedLifestyle.BeginScope(simpleInjectorContainer); | ||
|
||
|
||
} | ||
|
||
[Benchmark] | ||
public void UsingLightInject() | ||
{ | ||
var instance = lightInjectScope.GetInstance<Foo>(); | ||
} | ||
|
||
[Benchmark] | ||
public void UsingSimpleInjector() | ||
{ | ||
var instance = simpleInjectorScope.GetInstance<Foo>(); | ||
} | ||
|
||
[Benchmark] | ||
public void UsingMicrosoft() | ||
{ | ||
#pragma warning disable IDE0059 | ||
var instance = microsoftScope.ServiceProvider.GetService<Foo>(); | ||
} | ||
} | ||
|
||
|
||
public class Foo | ||
{ | ||
|
||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.