Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cleaning up the build props/targets for the benchmarks folder #12

Merged
merged 1 commit into from
Oct 29, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 11 additions & 8 deletions TerraFX.Interop.Mimalloc.sln
Original file line number Diff line number Diff line change
Expand Up @@ -85,9 +85,11 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "benchmarks", "benchmarks",
docs\benchmarks\BenchmarkResultsRaw.md = docs\benchmarks\BenchmarkResultsRaw.md
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "TerraFX.Interop.Benchmarks", "TerraFX.Interop.Benchmarks", "{75885FEC-F528-4839-98BC-4D6C267B17C1}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Interop", "Interop", "{F359966E-F75B-4FE2-9B32-191DA1A5430C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TerraFX.Interop.Mimalloc.AllocatorsBenchmarks", "benchmarks\TerraFX.Interop.Benchmarks\TerraFX.Interop.Mimalloc.AllocatorsBenchmarks.csproj", "{75EA5B4B-9199-471A-809B-E460AF9FA5C8}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Mimalloc", "Mimalloc", "{D450790D-4285-4A7E-894C-0292E2C16594}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TerraFX.Interop.Mimalloc.Benchmarks", "benchmarks\Interop\Mimalloc\TerraFX.Interop.Mimalloc.Benchmarks.csproj", "{7FE0104E-1D3C-4175-8B87-1B87F49B488B}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand All @@ -103,10 +105,10 @@ Global
{FE1214EA-21BD-4087-AD01-D42DBA8572FE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE1214EA-21BD-4087-AD01-D42DBA8572FE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE1214EA-21BD-4087-AD01-D42DBA8572FE}.Release|Any CPU.Build.0 = Release|Any CPU
{75EA5B4B-9199-471A-809B-E460AF9FA5C8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{75EA5B4B-9199-471A-809B-E460AF9FA5C8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{75EA5B4B-9199-471A-809B-E460AF9FA5C8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{75EA5B4B-9199-471A-809B-E460AF9FA5C8}.Release|Any CPU.Build.0 = Release|Any CPU
{7FE0104E-1D3C-4175-8B87-1B87F49B488B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{7FE0104E-1D3C-4175-8B87-1B87F49B488B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{7FE0104E-1D3C-4175-8B87-1B87F49B488B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{7FE0104E-1D3C-4175-8B87-1B87F49B488B}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand All @@ -120,8 +122,9 @@ Global
{FE1214EA-21BD-4087-AD01-D42DBA8572FE} = {32D5D5C6-C467-4200-A978-4DCEBAD16ABF}
{2BDD70BB-9023-44D6-A27B-AB51F667C254} = {14317A6D-D419-404D-A4A9-E64088152E32}
{2F3C5A61-647D-4C08-A061-9EFE28E59962} = {8793898A-6542-4606-AA82-AB14151D2D20}
{75885FEC-F528-4839-98BC-4D6C267B17C1} = {F5A2F613-4AF4-4B25-A682-EB51DB0AA247}
{75EA5B4B-9199-471A-809B-E460AF9FA5C8} = {75885FEC-F528-4839-98BC-4D6C267B17C1}
{F359966E-F75B-4FE2-9B32-191DA1A5430C} = {F5A2F613-4AF4-4B25-A682-EB51DB0AA247}
{D450790D-4285-4A7E-894C-0292E2C16594} = {F359966E-F75B-4FE2-9B32-191DA1A5430C}
{7FE0104E-1D3C-4175-8B87-1B87F49B488B} = {D450790D-4285-4A7E-894C-0292E2C16594}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {2FE36DF8-2D9C-4F20-8787-45DC74B57461}
Expand Down
6 changes: 4 additions & 2 deletions benchmarks/Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@
-->

<PropertyGroup>
<EmbedUntrackedSources>true</EmbedUntrackedSources>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.props</MSBuildAllProjects>
<IsPackable>false</IsPackable>
<NoWarn>$(NoWarn);1591</NoWarn>
<OutputType>Exe</OutputType>
<TerraFXProjectCategory>benchmarks</TerraFXProjectCategory>
</PropertyGroup>

Expand All @@ -21,4 +22,5 @@
<ItemGroup>
<PackageReference Include="BenchmarkDotNet" IsImplicitlyDefined="true" PrivateAssets="all" />
</ItemGroup>

</Project>
5 changes: 1 addition & 4 deletions benchmarks/Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,6 @@
MSBuildAllProjects, as that is done by the file that imports us.
-->

<PropertyGroup>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileDirectory)..\Directory.Build.targets</MSBuildAllProjects>
</PropertyGroup>

<Import Project="$(MSBuildThisFileDirectory)..\Directory.Build.targets" />

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using BenchmarkDotNet.Attributes;
using static TerraFX.Interop.Mimalloc;

namespace TerraFX.Interop.Benchmarks
{
Expand All @@ -17,18 +18,18 @@ public unsafe class AllocatorBenchmarks
[Benchmark]
public void TestMimalloc()
{
for (int i = 0; i < IterCount; i++)
for (var i = 0; i < IterCount; i++)
{
var p = (byte*)TerraFX.Interop.Mimalloc.mi_malloc((nuint)Size);
var p = (byte*)mi_malloc((nuint)Size);
Consume(&p);
TerraFX.Interop.Mimalloc.mi_free(p);
mi_free(p);
}
}

[Benchmark]
public void TestGCAlloc()
{
for (int i = 0; i < IterCount; i++)
for (var i = 0; i < IterCount; i++)
{
var p = new byte[Size];
Consume(ref p);
Expand All @@ -38,7 +39,7 @@ public void TestGCAlloc()
[Benchmark]
public void TestNativeAlloc()
{
for (int i = 0; i < IterCount; i++)
for (var i = 0; i < IterCount; i++)
{
var p = (byte*)NativeMemory.Alloc((nuint)Size);
Consume(&p);
Expand All @@ -49,7 +50,7 @@ public void TestNativeAlloc()
[Benchmark]
public void TestAllocHGlobal()
{
for (int i = 0; i < IterCount; i++)
for (var i = 0; i < IterCount; i++)
{
var p = (byte*)Marshal.AllocHGlobal(Size);
Consume(&p);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
// Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information.

using TerraFX.Interop.Benchmarks;
using BenchmarkDotNet.Running;
using TerraFX.Interop.Benchmarks;

BenchmarkRunner.Run<AllocatorBenchmarks>();
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright © Tanner Gooding and Contributors. Licensed under the MIT License (MIT). See License.md in the repository root for more information. -->
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<RootNamespace>TerraFX.Interop.Benchmarks</RootNamespace>
<TargetFrameworks>net6.0</TargetFrameworks>
</PropertyGroup>

<ItemGroup>
<ProjectReference Include="..\..\..\sources\Interop\Mimalloc\TerraFX.Interop.Mimalloc.csproj" />
</ItemGroup>

</Project>

This file was deleted.