mirror of
https://github.com/aaru-dps/AaruBenchmark.git
synced 2025-12-16 19:24:36 +00:00
Add job attribute to run benchmarks in .NET Core 3.1 under Rosetta.
This commit is contained in:
@@ -1,14 +1,35 @@
|
|||||||
using System;
|
using System;
|
||||||
using AaruBenchmark.Checksums;
|
using AaruBenchmark.Checksums;
|
||||||
using BenchmarkDotNet.Attributes;
|
using BenchmarkDotNet.Attributes;
|
||||||
|
using BenchmarkDotNet.Configs;
|
||||||
|
using BenchmarkDotNet.Environments;
|
||||||
using BenchmarkDotNet.Jobs;
|
using BenchmarkDotNet.Jobs;
|
||||||
|
using BenchmarkDotNet.Toolchains.CsProj;
|
||||||
|
using BenchmarkDotNet.Toolchains.DotNetCli;
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
using AaruBenchmark.Compression;
|
using AaruBenchmark.Compression;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
namespace AaruBenchmark;
|
namespace AaruBenchmark;
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Assembly)]
|
||||||
|
public class Core31RosettaJobAttribute : Attribute, IConfigSource
|
||||||
|
{
|
||||||
|
public Core31RosettaJobAttribute()
|
||||||
|
{
|
||||||
|
Job job = new Job(".NET Core 3.1 (x64)", RunMode.Default).WithRuntime(CoreRuntime.Core31);
|
||||||
|
|
||||||
|
NetCoreAppSettings dotnetCli32Bit =
|
||||||
|
NetCoreAppSettings.NetCoreApp31.WithCustomDotNetCliPath(@"/usr/local/share/dotnet/x64/dotnet", "x64");
|
||||||
|
|
||||||
|
Config = ManualConfig.CreateEmpty().AddJob(job.WithToolchain(CsProjCoreToolchain.From(dotnetCli32Bit)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public IConfig Config { get; }
|
||||||
|
}
|
||||||
|
|
||||||
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class ADCBenchs
|
public class ADCBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -32,7 +53,8 @@ public class ADCBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class AppleRleBenchs
|
public class AppleRleBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -56,7 +78,8 @@ public class AppleRleBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class TeleDiskLzhBenchs
|
public class TeleDiskLzhBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -74,7 +97,8 @@ public class TeleDiskLzhBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class GzipBenchs
|
public class GzipBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -95,7 +119,8 @@ public class GzipBenchs
|
|||||||
public void DotNetZip() => Compression.DotNetZip.Gzip();
|
public void DotNetZip() => Compression.DotNetZip.Gzip();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class CompressGzipBenchs
|
public class CompressGzipBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -116,7 +141,8 @@ public class CompressGzipBenchs
|
|||||||
public void DotNetZip() => Compression.DotNetZip.CompressGzip();
|
public void DotNetZip() => Compression.DotNetZip.CompressGzip();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Bzip2Benchs
|
public class Bzip2Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -140,7 +166,8 @@ public class Bzip2Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class CompressBzip2Benchs
|
public class CompressBzip2Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -164,7 +191,8 @@ public class CompressBzip2Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class LzipBenchs
|
public class LzipBenchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -179,7 +207,8 @@ public class LzipBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class CompressLzipBenchs
|
public class CompressLzipBenchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -194,7 +223,8 @@ public class CompressLzipBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class LzmaBenchs
|
public class LzmaBenchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -208,7 +238,8 @@ public class LzmaBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class CompressLzmaBenchs
|
public class CompressLzmaBenchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -223,7 +254,8 @@ public class CompressLzmaBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class FlacBenchs
|
public class FlacBenchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -238,7 +270,8 @@ public class FlacBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class CompressFlacBenchs
|
public class CompressFlacBenchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -253,7 +286,8 @@ public class CompressFlacBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Adler32Benchs
|
public class Adler32Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -277,7 +311,8 @@ public class Adler32Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Fletcher16Benchs
|
public class Fletcher16Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -301,7 +336,8 @@ public class Fletcher16Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Fletcher32Benchs
|
public class Fletcher32Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -325,7 +361,8 @@ public class Fletcher32Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Crc16CcittBenchs
|
public class Crc16CcittBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -349,7 +386,8 @@ public class Crc16CcittBenchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Crc16Benchs
|
public class Crc16Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -373,7 +411,8 @@ public class Crc16Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Crc32Benchs
|
public class Crc32Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -400,7 +439,8 @@ public class Crc32Benchs
|
|||||||
public void rhash() => RHash.Crc32();
|
public void rhash() => RHash.Crc32();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Crc64Benchs
|
public class Crc64Benchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
@@ -424,7 +464,8 @@ public class Crc64Benchs
|
|||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Md5Benchs
|
public class Md5Benchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -437,7 +478,8 @@ public class Md5Benchs
|
|||||||
public void rhash() => RHash.Md5();
|
public void rhash() => RHash.Md5();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Sha1Benchs
|
public class Sha1Benchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -450,7 +492,8 @@ public class Sha1Benchs
|
|||||||
public void rhash() => RHash.Sha1();
|
public void rhash() => RHash.Sha1();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Sha256Benchs
|
public class Sha256Benchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -463,7 +506,8 @@ public class Sha256Benchs
|
|||||||
public void rhash() => RHash.Sha256();
|
public void rhash() => RHash.Sha256();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Sha384Benchs
|
public class Sha384Benchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -476,7 +520,8 @@ public class Sha384Benchs
|
|||||||
public void rhash() => RHash.Sha384();
|
public void rhash() => RHash.Sha384();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class Sha512Benchs
|
public class Sha512Benchs
|
||||||
{
|
{
|
||||||
[Benchmark(Baseline = true)]
|
[Benchmark(Baseline = true)]
|
||||||
@@ -489,7 +534,8 @@ public class Sha512Benchs
|
|||||||
public void rhash() => RHash.Sha512();
|
public void rhash() => RHash.Sha512();
|
||||||
}
|
}
|
||||||
|
|
||||||
[SimpleJob(RuntimeMoniker.NetCoreApp31), SimpleJob(RuntimeMoniker.Net80), SimpleJob(RuntimeMoniker.NativeAot80)]
|
[SimpleJob(RuntimeMoniker.NetCoreApp31), Core31RosettaJob, SimpleJob(RuntimeMoniker.Net80),
|
||||||
|
SimpleJob(RuntimeMoniker.NativeAot80)]
|
||||||
public class SpamSumBenchs
|
public class SpamSumBenchs
|
||||||
{
|
{
|
||||||
#if NET8_0_OR_GREATER
|
#if NET8_0_OR_GREATER
|
||||||
|
|||||||
Reference in New Issue
Block a user