Add benchmarks project
This commit is contained in:
19
tests/Roslyn.Benchmarks/MSBuildWorkspaceBenchmarks.cs
Normal file
19
tests/Roslyn.Benchmarks/MSBuildWorkspaceBenchmarks.cs
Normal 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;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user