Skip to content
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
38 changes: 29 additions & 9 deletions sandbox/Benchmark/Benchmark.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,13 @@
<Nullable>enable</Nullable>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)'=='NuGetCsToml'">
<Optimize>true</Optimize>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
<DefineConstants>RELEASE;TRACE</DefineConstants>
</PropertyGroup>

<ItemGroup>
<None Remove="Toml\test.toml" />
</ItemGroup>
Expand All @@ -25,13 +32,26 @@
<PackageReference Include="Tommy" Version="3.1.2" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\src\CsToml.Extensions\CsToml.Extensions.csproj" />
<ProjectReference Include="..\..\src\CsToml\CsToml.csproj" />
<ProjectReference Include="..\..\src\CsToml.Generator\CsToml.Generator.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>

<Choose>
<When Condition="'$(Configuration)'=='NuGetCsToml'">
<ItemGroup>
<PackageReference Include="CsToml" Version="1.8.1" />
<PackageReference Include="CsToml.Extensions" Version="1.8.1" />
<PackageReference Include="CsToml.Generator" Version="1.8.1">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference>
</ItemGroup>
</When>
<Otherwise>
<ItemGroup>
<ProjectReference Include="..\..\src\CsToml.Extensions\CsToml.Extensions.csproj" />
<ProjectReference Include="..\..\src\CsToml\CsToml.csproj" />
<ProjectReference Include="..\..\src\CsToml.Generator\CsToml.Generator.csproj">
<OutputItemType>Analyzer</OutputItemType>
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
</ProjectReference>
</ItemGroup>
</Otherwise>
</Choose>
</Project>
25 changes: 14 additions & 11 deletions sandbox/Benchmark/Config/BenchmarkConfig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,6 @@ public BenchmarkConfig()
AddValidator(DefaultConfig.Instance.GetValidators().ToArray());
AddLogger(ConsoleLogger.Default);

// .NET 10.0 as default.
AddJob(Job.ShortRun
.WithStrategy(RunStrategy.Throughput)
.DontEnforcePowerPlan()
.WithToolchain(CsProjCoreToolchain.NetCoreApp10_0)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp10_0.Name}"));
}

public BenchmarkConfig AddTargetFramework()
{
// Add .NET 8.0
AddJob(Job.ShortRun
.WithStrategy(RunStrategy.Throughput)
Expand All @@ -52,7 +42,20 @@ public BenchmarkConfig AddTargetFramework()
.WithToolchain(CsProjCoreToolchain.NetCoreApp90)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp90.Name}"));

return this;
// .NET 10.0 as default.
AddJob(Job.ShortRun
.WithStrategy(RunStrategy.Throughput)
.DontEnforcePowerPlan()
.WithToolchain(CsProjCoreToolchain.NetCoreApp10_0)
.WithId($"Benchmark{CsProjCoreToolchain.NetCoreApp10_0.Name}"));

// NuGet version
AddJob(Job.ShortRun
.WithStrategy(RunStrategy.Throughput)
.DontEnforcePowerPlan()
.WithToolchain(CsProjCoreToolchain.NetCoreApp10_0)
.WithCustomBuildConfiguration("NuGetCsToml")
.WithId("NuGetCsToml"));
}

}
3 changes: 1 addition & 2 deletions sandbox/Benchmark/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,7 @@
return;
#else

//var config = new BenchmarkConfig();
var config = new BenchmarkConfig().AddTargetFramework();
var config = new BenchmarkConfig();
var summaries = BenchmarkSwitcher.FromAssembly(typeof(Program).Assembly).Run(args, config).ToArray();
if (summaries.Length == 0)
{
Expand Down
Loading