From 189c07bf19584e354054c9698f52507ade60e0eb Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Fri, 24 Feb 2023 12:30:14 +1000 Subject: [PATCH] Fix benchmarks --- .../Color/Bulk/PremultiplyVector4.cs | 10 +++------- .../Color/Bulk/UnPremultiplyVector4.cs | 10 +++------- 2 files changed, 6 insertions(+), 14 deletions(-) diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/PremultiplyVector4.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/PremultiplyVector4.cs index d30693c6c7..cab81cb7f2 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/PremultiplyVector4.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/PremultiplyVector4.cs @@ -8,7 +8,6 @@ using BenchmarkDotNet.Attributes; namespace SixLabors.ImageSharp.Benchmarks.ColorSpaces.Bulk; -[Config(typeof(Config.ShortCore31))] public class PremultiplyVector4 { private static readonly Vector4[] Vectors = CreateVectors(); @@ -26,10 +25,7 @@ public class PremultiplyVector4 } [Benchmark] - public void Premultiply() - { - Numerics.Premultiply(Vectors); - } + public void Premultiply() => Numerics.Premultiply(Vectors); [MethodImpl(InliningOptions.ShortMethod)] private static void Premultiply(ref Vector4 source) @@ -41,13 +37,13 @@ public class PremultiplyVector4 private static Vector4[] CreateVectors() { - var rnd = new Random(42); + Random rnd = new(42); return GenerateRandomVectorArray(rnd, 2048, 0, 1); } private static Vector4[] GenerateRandomVectorArray(Random rnd, int length, float minVal, float maxVal) { - var values = new Vector4[length]; + Vector4[] values = new Vector4[length]; for (int i = 0; i < length; i++) { diff --git a/tests/ImageSharp.Benchmarks/Color/Bulk/UnPremultiplyVector4.cs b/tests/ImageSharp.Benchmarks/Color/Bulk/UnPremultiplyVector4.cs index ea36a341fc..d653fca296 100644 --- a/tests/ImageSharp.Benchmarks/Color/Bulk/UnPremultiplyVector4.cs +++ b/tests/ImageSharp.Benchmarks/Color/Bulk/UnPremultiplyVector4.cs @@ -8,7 +8,6 @@ using BenchmarkDotNet.Attributes; namespace SixLabors.ImageSharp.Benchmarks.ColorSpaces.Bulk; -[Config(typeof(Config.ShortCore31))] public class UnPremultiplyVector4 { private static readonly Vector4[] Vectors = CreateVectors(); @@ -26,10 +25,7 @@ public class UnPremultiplyVector4 } [Benchmark] - public void UnPremultiply() - { - Numerics.UnPremultiply(Vectors); - } + public void UnPremultiply() => Numerics.UnPremultiply(Vectors); [MethodImpl(InliningOptions.ShortMethod)] private static void UnPremultiply(ref Vector4 source) @@ -41,13 +37,13 @@ public class UnPremultiplyVector4 private static Vector4[] CreateVectors() { - var rnd = new Random(42); + Random rnd = new(42); return GenerateRandomVectorArray(rnd, 2048, 0, 1); } private static Vector4[] GenerateRandomVectorArray(Random rnd, int length, float minVal, float maxVal) { - var values = new Vector4[length]; + Vector4[] values = new Vector4[length]; for (int i = 0; i < length; i++) {