Skip to content

Commit ccffaa9

Browse files
committed
[Infra] Add Benchmark project.
1 parent 0763491 commit ccffaa9

File tree

5 files changed

+48
-0
lines changed

5 files changed

+48
-0
lines changed

Build/Common.Benchmark.props

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<Project>
2+
<PropertyGroup Label="Framework">
3+
<DefaultTargetFrameworks>netcoreapp2.0;net461</DefaultTargetFrameworks>
4+
</PropertyGroup>
5+
6+
<PropertyGroup>
7+
<OutputType>Exe</OutputType>
8+
</PropertyGroup>
9+
10+
<ItemGroup>
11+
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
12+
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.4" />
13+
</ItemGroup>
14+
</Project>

StructLinq.sln

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,16 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructLinq", "src\StructLin
77
EndProject
88
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{2987C571-432E-4640-8D24-A3F8C9341276}"
99
ProjectSection(SolutionItems) = preProject
10+
Build\Common.Benchmark.props = Build\Common.Benchmark.props
1011
Build\Common.props = Build\Common.props
1112
Build\Common.Tests.props = Build\Common.Tests.props
1213
src\Directory.Build.props = src\Directory.Build.props
1314
EndProjectSection
1415
EndProject
1516
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructLinq.Tests", "src\StructLinq.Tests\StructLinq.Tests.csproj", "{355C025E-3001-40F0-A456-05C13AF94466}"
1617
EndProject
18+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StructLinq.Benchmark", "src\StructLinq.Benchmark\StructLinq.Benchmark.csproj", "{363DB35F-7108-4DE4-AE6C-62950E53D84E}"
19+
EndProject
1720
Global
1821
GlobalSection(SolutionConfigurationPlatforms) = preSolution
1922
Debug|Any CPU = Debug|Any CPU
@@ -28,6 +31,10 @@ Global
2831
{355C025E-3001-40F0-A456-05C13AF94466}.Debug|Any CPU.Build.0 = Debug|Any CPU
2932
{355C025E-3001-40F0-A456-05C13AF94466}.Release|Any CPU.ActiveCfg = Release|Any CPU
3033
{355C025E-3001-40F0-A456-05C13AF94466}.Release|Any CPU.Build.0 = Release|Any CPU
34+
{363DB35F-7108-4DE4-AE6C-62950E53D84E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
35+
{363DB35F-7108-4DE4-AE6C-62950E53D84E}.Debug|Any CPU.Build.0 = Debug|Any CPU
36+
{363DB35F-7108-4DE4-AE6C-62950E53D84E}.Release|Any CPU.ActiveCfg = Release|Any CPU
37+
{363DB35F-7108-4DE4-AE6C-62950E53D84E}.Release|Any CPU.Build.0 = Release|Any CPU
3138
EndGlobalSection
3239
GlobalSection(SolutionProperties) = preSolution
3340
HideSolutionNode = FALSE

src/Directory.Build.props

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@
44
</PropertyGroup>
55
<Import Project="$(RootDir)\Build\Common.props"/>
66
<Import Condition="$(MSBuildProjectName.EndsWith('Tests'))" Project="$(RootDir)\Build\Common.Tests.props"/>
7+
<Import Condition="$(MSBuildProjectName.EndsWith('Benchmark'))" Project="$(RootDir)\Build\Common.Benchmark.props"/>
78
</Project>
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
using BenchmarkDotNet.Running;
2+
3+
namespace StructLinq.Benchmark
4+
{
5+
public class Program
6+
{
7+
public static void Main(string[] args) => BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args);
8+
}
9+
10+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<TargetFrameworks>$(DefaultTargetFrameworks)</TargetFrameworks>
5+
</PropertyGroup>
6+
7+
<ItemGroup>
8+
<PackageReference Include="BenchmarkDotNet" Version="0.11.4" />
9+
<PackageReference Include="BenchmarkDotNet.Diagnostics.Windows" Version="0.11.4" />
10+
</ItemGroup>
11+
12+
<ItemGroup>
13+
<ProjectReference Include="..\StructLinq\StructLinq.csproj" />
14+
</ItemGroup>
15+
16+
</Project>

0 commit comments

Comments
 (0)