From 057a4302e8503cadcbc29253492b980b70c291ce Mon Sep 17 00:00:00 2001 From: antonfirsov Date: Wed, 15 Apr 2026 21:57:42 +0200 Subject: [PATCH] Add GaussianBlur throughput benchmark and pass Configuration where missed --- .../ProcessorThroughputBenchmark.cs | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs index e9adf58449..a74bd25851 100644 --- a/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs +++ b/tests/ImageSharp.Tests.ProfilingSandbox/ProcessorThroughputBenchmark.cs @@ -53,6 +53,7 @@ public sealed class ProcessorThroughputBenchmark Method.BinaryThreshold => this.BinaryThreshold, Method.Histogram => this.Histogram, Method.OilPaint => this.OilPaint, + Method.GaussianBlur => this.GaussianBlur, _ => throw new NotImplementedException(), }; @@ -151,21 +152,28 @@ public sealed class ProcessorThroughputBenchmark { using Image image = new(this.options.Width, this.options.Height); using Image foreground = new(this.options.Width, this.options.Height); - image.Mutate(c => c.DrawImage(foreground, 0.5f)); + image.Mutate(this.configuration, c => c.DrawImage(foreground, 0.5f)); return image.Width * image.Height; } private int BinaryThreshold() { using Image image = new(this.options.Width, this.options.Height); - image.Mutate(c => c.BinaryThreshold(0.5f)); + image.Mutate(this.configuration, c => c.BinaryThreshold(0.5f)); return image.Width * image.Height; } private int Histogram() { using Image image = new(this.options.Width, this.options.Height); - image.Mutate(c => c.HistogramEqualization()); + image.Mutate(this.configuration, c => c.HistogramEqualization()); + return image.Width * image.Height; + } + + private int GaussianBlur() + { + using Image image = new(this.options.Width, this.options.Height); + image.Mutate(this.configuration, c => c.GaussianBlur()); return image.Width * image.Height; } @@ -176,7 +184,8 @@ public sealed class ProcessorThroughputBenchmark DrawImage, BinaryThreshold, Histogram, - OilPaint + OilPaint, + GaussianBlur, } private sealed class CommandLineOptions