rearrange
This commit is contained in:
@@ -1,14 +1,10 @@
|
||||
using System.Diagnostics;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Microsoft.CodeAnalysis.MSBuild;
|
||||
|
||||
namespace Roslyn.Benchmarks;
|
||||
|
||||
public class MSBuildWorkspaceBenchmarks
|
||||
public class CreateWorkspaceBenchmarks
|
||||
{
|
||||
private const string _solutionFilePath = "C:/Users/Matthew/Documents/Git/StatusApp/StatusApp.sln";
|
||||
|
||||
// | Method | Mean | Error | StdDev |
|
||||
// |-------------------------- |---------:|---------:|---------:|
|
||||
// | CreateWorkspaceNoParams | 10.88 us | 0.045 us | 0.042 us |
|
||||
@@ -32,11 +28,4 @@ public class MSBuildWorkspaceBenchmarks
|
||||
return workspace;
|
||||
}
|
||||
|
||||
// [Benchmark]
|
||||
// public async Task<Solution> ParseSolutionFileFromPath()
|
||||
// {
|
||||
// var workspace = MSBuildWorkspace.Create();
|
||||
// var solution = await workspace.OpenSolutionAsync(_solutionFilePath);
|
||||
// return solution;
|
||||
// }
|
||||
}
|
||||
21
tests/Roslyn.Benchmarks/ParseSolutionBenchmarks.cs
Normal file
21
tests/Roslyn.Benchmarks/ParseSolutionBenchmarks.cs
Normal file
@@ -0,0 +1,21 @@
|
||||
using BenchmarkDotNet.Attributes;
|
||||
using Microsoft.CodeAnalysis;
|
||||
using Microsoft.CodeAnalysis.MSBuild;
|
||||
|
||||
namespace Roslyn.Benchmarks;
|
||||
|
||||
public class ParseSolutionBenchmarks
|
||||
{
|
||||
private const string _solutionFilePath = "C:/Users/Matthew/Documents/Git/StatusApp/StatusApp.sln";
|
||||
|
||||
|
||||
//[IterationSetup]
|
||||
|
||||
[Benchmark]
|
||||
public async Task<Solution> ParseSolutionFileFromPath()
|
||||
{
|
||||
var workspace = MSBuildWorkspace.Create();
|
||||
var solution = await workspace.OpenSolutionAsync(_solutionFilePath);
|
||||
return solution;
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,5 @@
|
||||
using BenchmarkDotNet.Running;
|
||||
using Roslyn.Benchmarks;
|
||||
|
||||
BenchmarkRunner.Run<MSBuildWorkspaceBenchmarks>();
|
||||
//BenchmarkRunner.Run<CreateWorkspaceBenchmarks>();
|
||||
BenchmarkRunner.Run<ParseSolutionBenchmarks>();
|
||||
|
||||
Reference in New Issue
Block a user