From 38e6e1792b250c482f8b6891bb608fbed717997b Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Wed, 15 Apr 2026 22:10:12 +0200 Subject: [PATCH] also add `-m EdgesCompass` --- .../ProcessorThroughputBenchmark.cs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs index a74bd25851..e85a3ee972 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs @@ -6,6 +6,7 @@ using CommandLine; using CommandLine.Text; using SixLabors.ImageSharp.PixelFormats; using SixLabors.ImageSharp.Processing; +using SixLabors.ImageSharp.Processing.Processors.Convolution; namespace SixLabors.ImageSharp.Tests.ProfilingSandbox; @@ -49,6 +50,7 @@ public sealed class ProcessorThroughputBenchmark { Method.Crop => this.Crop, Method.Edges => this.DetectEdges, + Method.EdgesCompass => this.EdgesCompass, Method.DrawImage => this.DrawImage, Method.BinaryThreshold => this.BinaryThreshold, Method.Histogram => this.Histogram, @@ -139,6 +141,13 @@ public sealed class ProcessorThroughputBenchmark return image.Width * image.Height; } + private int EdgesCompass() + { + using Image image = new(this.options.Width, this.options.Height); + image.Mutate(this.configuration, x => x.DetectEdges(EdgeDetectorCompassKernel.Kirsch)); + return image.Width * image.Height; + } + private int Crop() { using Image image = new(this.options.Width, this.options.Height); @@ -180,6 +189,7 @@ public sealed class ProcessorThroughputBenchmark private enum Method { Edges, + EdgesCompass, Crop, DrawImage, BinaryThreshold,