Add benchmarks for .NET 7 in JIT and Native AOT modes.

This commit is contained in:
2022-09-14 02:04:40 +01:00
parent ad7f82d0fa
commit 02d34913fb
4 changed files with 79 additions and 23 deletions

View File

@@ -17,7 +17,7 @@
<Product>Aaru Data Preservation Suite</Product>
<Title>Aaru6.Checksums</Title>
<ApplicationVersion>$(Version)</ApplicationVersion>
<TargetFramework>net6</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<LangVersion>10</LangVersion>
<Description>C# implementation of CRC16, CRC32, CRC64, Fletcher, MD5, SHA1, SHA2 and SpamSum.</Description>
<PackageProjectUrl>https://github.com/aaru-dps/</PackageProjectUrl>

View File

@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net6.0</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>

View File

@@ -2,72 +2,72 @@
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net6</TargetFramework>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Aaru.Checksums" Version="5.3.0"/>
<PackageReference Include="Aaru.Compression" Version="5.3.0"/>
<PackageReference Include="Aaru.Compression.Native" Version="6.0.0-alpha8"/>
<PackageReference Include="BenchmarkDotNet" Version="0.13.1"/>
<PackageReference Include="DotNetZip" Version="1.15.0"/>
<PackageReference Include="SharpCompress" Version="0.30.0"/>
<PackageReference Include="Aaru.Checksums" Version="5.3.0" />
<PackageReference Include="Aaru.Compression" Version="5.3.0" />
<PackageReference Include="Aaru.Compression.Native" Version="6.0.0-alpha8" />
<PackageReference Include="BenchmarkDotNet" Version="0.13.2" />
<PackageReference Include="DotNetZip" Version="1.16.0" />
<PackageReference Include="SharpCompress" Version="0.32.2" />
</ItemGroup>
<ItemGroup>
<None Remove="data\random"/>
<None Remove="data\random" />
<Content Include="data\random">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\gzip.gz"/>
<None Remove="data\gzip.gz" />
<Content Include="data\gzip.gz">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\bzip2.bz2"/>
<None Remove="data\bzip2.bz2" />
<Content Include="data\bzip2.bz2">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\apple_rle.bin"/>
<None Remove="data\apple_rle.bin" />
<Content Include="data\apple_rle.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\teledisk_lzh.bin"/>
<None Remove="data\teledisk_lzh.bin" />
<Content Include="data\teledisk_lzh.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\adc.bin"/>
<None Remove="data\adc.bin" />
<Content Include="data\adc.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\lzip.lz"/>
<None Remove="data\lzip.lz" />
<Content Include="data\lzip.lz">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\lzma.bin"/>
<None Remove="data\lzma.bin" />
<Content Include="data\lzma.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\flac.flac"/>
<None Remove="data\flac.flac" />
<Content Include="data\flac.flac">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\audio.bin"/>
<None Remove="data\audio.bin" />
<Content Include="data\audio.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
<None Remove="data\data.bin"/>
<None Remove="data\data.bin" />
<Content Include="data\data.bin">
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</Content>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Aaru6.Checksums\Aaru6.Checksums.csproj"/>
<ProjectReference Include="..\Aaru6.Compression\Aaru6.Compression.csproj"/>
<ProjectReference Include="..\Aaru6.Checksums\Aaru6.Checksums.csproj" />
<ProjectReference Include="..\Aaru6.Compression\Aaru6.Compression.csproj" />
</ItemGroup>
<ItemGroup>
<Folder Include="data"/>
<Folder Include="data" />
</ItemGroup>
</Project>

View File

@@ -6,6 +6,8 @@ using BenchmarkDotNet.Jobs;
namespace AaruBenchmark
{
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class AppleRleBenchs
{
[Benchmark(Baseline = true)]
@@ -19,6 +21,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class TeleDiskLzhBenchs
{
[Benchmark(Baseline = true)]
@@ -29,6 +33,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class ADCBenchs
{
[Benchmark(Baseline = true)]
@@ -42,6 +48,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class GzipBenchs
{
[Benchmark]
@@ -55,6 +63,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressGzipBenchs
{
[Benchmark(Baseline = true)]
@@ -68,6 +78,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Bzip2Benchs
{
[Benchmark(Baseline = true)]
@@ -81,6 +93,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressBzip2Benchs
{
[Benchmark(Baseline = true)]
@@ -93,6 +107,9 @@ namespace AaruBenchmark
public void AaruNative() => Compression.AaruNative.CompressBzip2();
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class LzipBenchs
{
[Benchmark(Baseline = true)]
@@ -102,6 +119,9 @@ namespace AaruBenchmark
public void AaruNative() => Compression.AaruNative.Lzip();
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressLzipBenchs
{
[Benchmark(Baseline = true)]
@@ -111,6 +131,9 @@ namespace AaruBenchmark
public void AaruNative() => Compression.AaruNative.CompressLzip();
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class LzmaBenchs
{
[Benchmark(Baseline = true)]
@@ -120,6 +143,9 @@ namespace AaruBenchmark
public void AaruNative() => Compression.AaruNative.Lzma();
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressLzmaBenchs
{
[Benchmark(Baseline = true)]
@@ -130,6 +156,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class FlacBenchs
{
[Benchmark(Baseline = true)]
@@ -140,6 +168,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressFlacBenchs
{
[Benchmark(Baseline = true)]
@@ -150,6 +180,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Adler32Benchs
{
[Benchmark(Baseline = true)]
@@ -163,6 +195,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Fletcher16Benchs
{
[Benchmark(Baseline = true)]
@@ -176,6 +210,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Fletcher32Benchs
{
[Benchmark(Baseline = true)]
@@ -189,6 +225,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc16CcittBenchs
{
[Benchmark(Baseline = true)]
@@ -202,6 +240,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc16Benchs
{
[Benchmark(Baseline = true)]
@@ -215,6 +255,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc32Benchs
{
[Benchmark(Baseline = true)]
@@ -231,6 +273,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc64Benchs
{
[Benchmark(Baseline = true)]
@@ -244,6 +288,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Md5Benchs
{
[Benchmark(Baseline = true)]
@@ -257,6 +303,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha1Benchs
{
[Benchmark(Baseline = true)]
@@ -270,6 +318,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha256Benchs
{
[Benchmark(Baseline = true)]
@@ -283,6 +333,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha384Benchs
{
[Benchmark(Baseline = true)]
@@ -296,6 +348,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha512Benchs
{
[Benchmark(Baseline = true)]
@@ -309,6 +363,8 @@ namespace AaruBenchmark
}
[SimpleJob(RuntimeMoniker.Net60)]
[SimpleJob(RuntimeMoniker.Net70)]
[SimpleJob(RuntimeMoniker.NativeAot70)]
public class SpamSumBenchs
{
[Benchmark(Baseline = true)]