Skip to content

Commit b7cb5f0

Browse files
committed
ci: performance project scaffolding
1 parent 521d636 commit b7cb5f0

File tree

4 files changed

+66
-0
lines changed

4 files changed

+66
-0
lines changed

Microsoft.OpenApi.sln

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OpenApi.Hidi", "s
3030
EndProject
3131
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.OpenApi.Hidi.Tests", "test\Microsoft.OpenApi.Hidi.Tests\Microsoft.OpenApi.Hidi.Tests.csproj", "{6ADC5D41-EDD2-4206-B815-5DFF739C6832}"
3232
EndProject
33+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PerformanceTests", "performance\PerformanceTests.csproj", "{537E49E3-325E-40EE-A90E-7556D4D333AA}"
34+
EndProject
3335
Global
3436
GlobalSection(SolutionConfigurationPlatforms) = preSolution
3537
Debug|Any CPU = Debug|Any CPU
@@ -68,6 +70,10 @@ Global
6870
{6ADC5D41-EDD2-4206-B815-5DFF739C6832}.Debug|Any CPU.Build.0 = Debug|Any CPU
6971
{6ADC5D41-EDD2-4206-B815-5DFF739C6832}.Release|Any CPU.ActiveCfg = Release|Any CPU
7072
{6ADC5D41-EDD2-4206-B815-5DFF739C6832}.Release|Any CPU.Build.0 = Release|Any CPU
73+
{537E49E3-325E-40EE-A90E-7556D4D333AA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
74+
{537E49E3-325E-40EE-A90E-7556D4D333AA}.Debug|Any CPU.Build.0 = Debug|Any CPU
75+
{537E49E3-325E-40EE-A90E-7556D4D333AA}.Release|Any CPU.ActiveCfg = Release|Any CPU
76+
{537E49E3-325E-40EE-A90E-7556D4D333AA}.Release|Any CPU.Build.0 = Release|Any CPU
7177
EndGlobalSection
7278
GlobalSection(SolutionProperties) = preSolution
7379
HideSolutionNode = FALSE

performance/Benchmarks.cs

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
using System;
2+
using BenchmarkDotNet;
3+
using BenchmarkDotNet.Attributes;
4+
5+
namespace performance
6+
{
7+
public class Benchmarks
8+
{
9+
[Benchmark]
10+
public void Scenario1()
11+
{
12+
// Implement your benchmark here
13+
}
14+
15+
[Benchmark]
16+
public void Scenario2()
17+
{
18+
// Implement your benchmark here
19+
}
20+
}
21+
}
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
<PropertyGroup>
3+
<TargetFramework>net8.0</TargetFramework>
4+
<OutputType>Exe</OutputType>
5+
</PropertyGroup>
6+
<PropertyGroup>
7+
<PlatformTarget>AnyCPU</PlatformTarget>
8+
<DebugType>pdbonly</DebugType>
9+
<DebugSymbols>true</DebugSymbols>
10+
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
11+
<Optimize>true</Optimize>
12+
<Configuration>Release</Configuration>
13+
<IsPackable>false</IsPackable>
14+
</PropertyGroup>
15+
<ItemGroup>
16+
<PackageReference Include="BenchmarkDotNet" Version="0.14.0" />
17+
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.14.0" />
18+
</ItemGroup>
19+
<ItemGroup>
20+
<ProjectReference Include="..\src\Microsoft.OpenApi\Microsoft.OpenApi.csproj" />
21+
</ItemGroup>
22+
</Project>

performance/Program.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
using BenchmarkDotNet.Configs;
2+
using BenchmarkDotNet.Running;
3+
4+
namespace performance
5+
{
6+
public class Program
7+
{
8+
public static void Main(string[] args)
9+
{
10+
var config = DefaultConfig.Instance;
11+
var summary = BenchmarkRunner.Run<Benchmarks>(config, args);
12+
13+
// Use this to select benchmarks from the console:
14+
// var summaries = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config);
15+
}
16+
}
17+
}

0 commit comments

Comments
 (0)