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

@@ -0,0 +1,31 @@
using BenchmarkDotNet.Attributes;
using Microsoft.CodeAnalysis.MSBuild;
namespace Roslyn.Benchmarks;
public class CreateWorkspaceBenchmarks
{
// | Method | Mean | Error | StdDev |
// |-------------------------- |---------:|---------:|---------:|
// | CreateWorkspaceNoParams | 10.88 us | 0.045 us | 0.042 us |
// | CreateWorkspaceWithParams | 11.22 us | 0.072 us | 0.060 us |
[Benchmark]
public MSBuildWorkspace CreateWorkspaceNoParams()
{
var workspace = MSBuildWorkspace.Create();
return workspace;
}
[Benchmark]
public MSBuildWorkspace CreateWorkspaceWithParams()
{
var properties = new Dictionary<string, string>
{
{ "Configuration", "Debug" },
{ "Platform", "AnyCPU" }
};
var workspace = MSBuildWorkspace.Create(properties);
return workspace;
}
}