Files
SharpIDE/tests/Roslyn.Benchmarks/MSBuildWorkspaceBenchmarks.cs
Matthew Parker [SSW] 52671f0252 Add benchmarks project
2025-01-11 13:26:04 +10:00

20 lines
518 B
C#

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