Add benchmarks project

This commit is contained in:
Matthew Parker [SSW]
2025-01-11 13:26:04 +10:00
parent ced3a70988
commit 52671f0252
7 changed files with 67 additions and 17 deletions

View File

@@ -0,0 +1,19 @@
using System.Diagnostics;
using BenchmarkDotNet.Attributes;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.MSBuild;
namespace Roslyn.Benchmarks;
public class MSBuildWorkspaceBenchmarks
{
private const string _solutionFilePath = "C:/Users/Matthew/Documents/Git/StatusApp/StatusApp.sln";
[Benchmark]
public async Task<Solution> ParseSolutionFileFromPath()
{
var workspace = MSBuildWorkspace.Create();
var solution = await workspace.OpenSolutionAsync(_solutionFilePath);
return solution;
}
}