rearrange

This commit is contained in:
Matthew Parker [SSW]
2025-01-11 13:46:37 +10:00
parent 822e9e28ae
commit 52e1f33193
7 changed files with 39 additions and 19 deletions

View File

@@ -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;
// }
}

View 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;
}
}

View File

@@ -1,4 +1,5 @@
using BenchmarkDotNet.Running;
using Roslyn.Benchmarks;
BenchmarkRunner.Run<MSBuildWorkspaceBenchmarks>();
//BenchmarkRunner.Run<CreateWorkspaceBenchmarks>();
BenchmarkRunner.Run<ParseSolutionBenchmarks>();