Make tests use .NET Core 3.1 as Aaru 5 does.

This commit is contained in:
2023-09-19 15:59:52 +01:00
parent 3b83219146
commit 0d1c4ae69f
8 changed files with 312 additions and 110 deletions

View File

@@ -2,7 +2,8 @@
<PropertyGroup> <PropertyGroup>
<OutputType>Exe</OutputType> <OutputType>Exe</OutputType>
<TargetFrameworks>net6.0;net7.0</TargetFrameworks> <TargetFrameworks>netcoreapp3.1;net7.0</TargetFrameworks>
<LangVersion>latest</LangVersion>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
@@ -61,7 +62,7 @@
</Content> </Content>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup Condition="'$(TargetFramework)' == 'net7.0' ">
<ProjectReference Include="..\Aaru6.Checksums\Aaru6.Checksums.csproj"/> <ProjectReference Include="..\Aaru6.Checksums\Aaru6.Checksums.csproj"/>
<ProjectReference Include="..\Aaru6.Compression\Aaru6.Compression.csproj"/> <ProjectReference Include="..\Aaru6.Compression\Aaru6.Compression.csproj"/>
</ItemGroup> </ItemGroup>

View File

@@ -1,253 +1,430 @@
using System;
using AaruBenchmark.Checksums; using AaruBenchmark.Checksums;
using AaruBenchmark.Compression;
using BenchmarkDotNet.Attributes; using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Jobs; using BenchmarkDotNet.Jobs;
#if NET7_0
using AaruBenchmark.Compression;
#endif
namespace AaruBenchmark; namespace AaruBenchmark;
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class AppleRleBenchs
{
[Benchmark(Baseline = true)]
public void Aaru() => Compression.Aaru.AppleRle();
[Benchmark]
public void Aaru6() => Aaru6Compressions.AppleRle();
[Benchmark]
public void AaruNative() => Compression.AaruNative.AppleRle();
}
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class TeleDiskLzhBenchs
{
[Benchmark(Baseline = true)]
public void Aaru() => Compression.Aaru.TeleDiskLzh();
[Benchmark]
public void Aaru6() => Aaru6Compressions.TeleDiskLzh();
}
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class ADCBenchs public class ADCBenchs
{ {
[Benchmark(Baseline = true)] #if NET7_0
public void Aaru() => Compression.SharpCompress.ADC();
[Benchmark] [Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Aaru6Compressions.ADC(); public void Aaru6() => Aaru6Compressions.ADC();
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.ADC(); public void AaruNative() => Compression.AaruNative.ADC();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Compression.SharpCompress.ADC();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class GzipBenchs public class AppleRleBenchs
{ {
#if NET7_0
[Benchmark] [Benchmark]
public void SharpCompress() => Compression.SharpCompress.Gzip(); public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void DotNetRuntime() => NetRuntime.Gzip(); public void Aaru6() => Aaru6Compressions.AppleRle();
[Benchmark]
public void AaruNative() => Compression.AaruNative.AppleRle();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Compression.Aaru.AppleRle();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class TeleDiskLzhBenchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Aaru6Compressions.TeleDiskLzh();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Compression.Aaru.TeleDiskLzh();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class GzipBenchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => NetRuntime.Gzip();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Compression.SharpCompress.Gzip();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
#endif
[Benchmark] [Benchmark]
public void DotNetZip() => Compression.DotNetZip.Gzip(); public void DotNetZip() => Compression.DotNetZip.Gzip();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressGzipBenchs public class CompressGzipBenchs
{ {
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => NetRuntime.CompressGzip();
#else
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Compression.SharpCompress.CompressGzip(); public void Aaru() => Compression.SharpCompress.CompressGzip();
[Benchmark] [Benchmark]
public void Aaru6() => NetRuntime.CompressGzip(); public void Aaru6() => throw new NotImplementedException();
#endif
[Benchmark] [Benchmark]
public void DotNetZip() => Compression.DotNetZip.CompressGzip(); public void DotNetZip() => Compression.DotNetZip.CompressGzip();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Bzip2Benchs public class Bzip2Benchs
{ {
[Benchmark(Baseline = true)] #if NET7_0
public void SharpCompress() => Compression.SharpCompress.Bzip2();
[Benchmark] [Benchmark]
public void DotNetZip() => Compression.DotNetZip.Bzip2(); public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => DotNetZip.Bzip2();
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.Bzip2(); public void AaruNative() => Compression.AaruNative.Bzip2();
} #else
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressBzip2Benchs
{
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Compression.SharpCompress.CompressBzip2(); public void Aaru() => Compression.SharpCompress.Bzip2();
[Benchmark] [Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressBzip2Benchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => DotNetZip.CompressBzip2(); public void Aaru6() => DotNetZip.CompressBzip2();
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.CompressBzip2(); public void AaruNative() => Compression.AaruNative.CompressBzip2();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Compression.SharpCompress.CompressBzip2();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class LzipBenchs public class LzipBenchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void SharpCompress() => Compression.SharpCompress.Lzip(); public void Aaru() => Compression.SharpCompress.Lzip();
#if NET7_0
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.Lzip(); public void AaruNative() => Compression.AaruNative.Lzip();
#else
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressLzipBenchs public class CompressLzipBenchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void SharpCompress() => Compression.SharpCompress.CompressLzip(); public void Aaru() => Compression.SharpCompress.CompressLzip();
#if NET7_0
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.CompressLzip(); public void AaruNative() => Compression.AaruNative.CompressLzip();
#else
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class LzmaBenchs public class LzmaBenchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void SharpCompress() => Compression.SharpCompress.Lzma(); public void Aaru() => Compression.SharpCompress.Lzma();
#if NET7_0
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.Lzma(); public void AaruNative() => Compression.AaruNative.Lzma();
#else
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressLzmaBenchs public class CompressLzmaBenchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void SharpCompress() => Compression.SharpCompress.CompressLzma(); public void Aaru() => Compression.SharpCompress.CompressLzma();
#if NET7_0
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.CompressLzma(); public void AaruNative() => Compression.AaruNative.CompressLzma();
#else
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class FlacBenchs public class FlacBenchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Compression.Aaru.Flac(); public void Aaru() => Compression.Aaru.Flac();
#if NET7_0
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.Flac(); public void AaruNative() => Compression.AaruNative.Flac();
#else
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class CompressFlacBenchs public class CompressFlacBenchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Compression.Aaru.CompressFlac(); public void Aaru() => Compression.Aaru.CompressFlac();
#if NET7_0
[Benchmark] [Benchmark]
public void AaruNative() => Compression.AaruNative.CompressFlac(); public void AaruNative() => Compression.AaruNative.CompressFlac();
#else
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Adler32Benchs public class Adler32Benchs
{ {
[Benchmark(Baseline = true)] #if NET7_0
public void Aaru() => Checksums.Aaru.Adler32();
[Benchmark] [Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Adler32(); public void Aaru6() => Checksums.Aaru6.Adler32();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Adler32(); public void AaruNative() => Checksums.AaruNative.Adler32();
} #else
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Fletcher16Benchs
{
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Fletcher16(); public void Aaru() => Checksums.Aaru.Adler32();
[Benchmark] [Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Fletcher16Benchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Fletcher16(); public void Aaru6() => Checksums.Aaru6.Fletcher16();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Fletcher16(); public void AaruNative() => Checksums.AaruNative.Fletcher16();
} #else
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Fletcher32Benchs
{
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Fletcher32(); public void Aaru() => Checksums.Aaru.Fletcher16();
[Benchmark] [Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Fletcher32Benchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Fletcher32(); public void Aaru6() => Checksums.Aaru6.Fletcher32();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Fletcher32(); public void AaruNative() => Checksums.AaruNative.Fletcher32();
} #else
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc16CcittBenchs
{
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Crc16Ccitt(); public void Aaru() => Checksums.Aaru.Fletcher32();
[Benchmark] [Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc16CcittBenchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Crc16Ccitt(); public void Aaru6() => Checksums.Aaru6.Crc16Ccitt();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Crc16Ccitt(); public void AaruNative() => Checksums.AaruNative.Crc16Ccitt();
} #else
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc16Benchs
{
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Crc16(); public void Aaru() => Checksums.Aaru.Crc16Ccitt();
[Benchmark] [Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc16Benchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Crc16(); public void Aaru6() => Checksums.Aaru6.Crc16();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Crc16(); public void AaruNative() => Checksums.AaruNative.Crc16();
} #else
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc32Benchs
{
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Crc32(); public void Aaru() => Checksums.Aaru.Crc16();
[Benchmark] [Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
}
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc32Benchs
{
#if NET7_0
[Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Crc32(); public void Aaru6() => Checksums.Aaru6.Crc32();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Crc32(); public void AaruNative() => Checksums.AaruNative.Crc32();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Crc32();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
[Benchmark] [Benchmark]
public void rhash() => RHash.Crc32(); public void rhash() => RHash.Crc32();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Crc64Benchs public class Crc64Benchs
{ {
[Benchmark(Baseline = true)] #if NET7_0
public void Aaru() => Checksums.Aaru.Crc64();
[Benchmark] [Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.Crc64(); public void Aaru6() => Checksums.Aaru6.Crc64();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.Crc64(); public void AaruNative() => Checksums.AaruNative.Crc64();
#else
[Benchmark(Baseline = true)]
public void Aaru() => Checksums.Aaru.Crc64();
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Md5Benchs public class Md5Benchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
@@ -260,7 +437,7 @@ public class Md5Benchs
public void rhash() => RHash.Md5(); public void rhash() => RHash.Md5();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha1Benchs public class Sha1Benchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
@@ -273,7 +450,7 @@ public class Sha1Benchs
public void rhash() => RHash.Sha1(); public void rhash() => RHash.Sha1();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha256Benchs public class Sha256Benchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
@@ -286,7 +463,7 @@ public class Sha256Benchs
public void rhash() => RHash.Sha256(); public void rhash() => RHash.Sha256();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha384Benchs public class Sha384Benchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
@@ -299,7 +476,7 @@ public class Sha384Benchs
public void rhash() => RHash.Sha384(); public void rhash() => RHash.Sha384();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class Sha512Benchs public class Sha512Benchs
{ {
[Benchmark(Baseline = true)] [Benchmark(Baseline = true)]
@@ -312,17 +489,25 @@ public class Sha512Benchs
public void rhash() => RHash.Sha512(); public void rhash() => RHash.Sha512();
} }
[SimpleJob(RuntimeMoniker.Net60), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)] [SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net70), SimpleJob(RuntimeMoniker.NativeAot70)]
public class SpamSumBenchs public class SpamSumBenchs
{ {
[Benchmark(Baseline = true)] #if NET7_0
public void Aaru() => Checksums.Aaru.SpamSum();
[Benchmark] [Benchmark]
public void Aaru() => throw new NotImplementedException();
[Benchmark(Baseline = true)]
public void Aaru6() => Checksums.Aaru6.SpamSum(); public void Aaru6() => Checksums.Aaru6.SpamSum();
[Benchmark] [Benchmark]
public void AaruNative() => Checksums.AaruNative.SpamSum(); public void AaruNative() => Checksums.AaruNative.SpamSum();
#else
[Benchmark]
public void Aaru6() => throw new NotImplementedException();
[Benchmark]
public void AaruNative() => throw new NotImplementedException();
#endif
[Benchmark] [Benchmark]
public void ssdeep() => Checksums.Aaru.CliSpamSum(); public void ssdeep() => Checksums.Aaru.CliSpamSum();

View File

@@ -1,3 +1,4 @@
#if NET7_0
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -243,3 +244,4 @@ public class Aaru6
string result = ctx.End(); string result = ctx.End();
} }
} }
#endif

View File

@@ -1,3 +1,4 @@
#if NET7_0
using System; using System;
using System.IO; using System.IO;
using System.Linq; using System.Linq;
@@ -271,3 +272,4 @@ public class AaruNative
spamsum_free(ctx); spamsum_free(ctx);
} }
} }
#endif

View File

@@ -1,6 +1,10 @@
using System.IO; using System.IO;
using Aaru.Compression; #if NET7_0
using Aaru6.Checksums; using Aaru6.Checksums;
#else
using Aaru.Checksums;
#endif
using Aaru.Compression;
using CUETools.Codecs; using CUETools.Codecs;
using CUETools.Codecs.Flake; using CUETools.Codecs.Flake;

View File

@@ -1,3 +1,4 @@
#if NET7_0
using System.IO; using System.IO;
using Aaru6.Checksums; using Aaru6.Checksums;
using Aaru6.Compression; using Aaru6.Compression;
@@ -93,3 +94,4 @@ public class Aaru6Compressions
throw new InvalidDataException("Incorrect decompressed checksum"); throw new InvalidDataException("Incorrect decompressed checksum");
} }
} }
#endif

View File

@@ -1,3 +1,4 @@
#if NET7_0
using System.Diagnostics.CodeAnalysis; using System.Diagnostics.CodeAnalysis;
using System.IO; using System.IO;
using System.Runtime.InteropServices; using System.Runtime.InteropServices;
@@ -306,3 +307,4 @@ public class AaruNative
(uint)"Aaru.Compression.Native.Tests".Length); (uint)"Aaru.Compression.Native.Tests".Length);
} }
} }
#endif

View File

@@ -1,5 +1,9 @@
using System.IO; using System.IO;
#if NET7_0
using Aaru6.Checksums; using Aaru6.Checksums;
#else
using Aaru.Checksums;
#endif
using SharpCompress.Compressors; using SharpCompress.Compressors;
using SharpCompress.Compressors.ADC; using SharpCompress.Compressors.ADC;
using SharpCompress.Compressors.BZip2; using SharpCompress.Compressors.BZip2;