1- // <copyright file="MultiImageBenchmarkBase.cs" company="James Jackson-South">
2- // Copyright (c) James Jackson-South and contributors.
1+ // Copyright (c) Six Labors and contributors.
32// Licensed under the Apache License, Version 2.0.
4- // </copyright>
53
64using BenchmarkDotNet . Configs ;
75using BenchmarkDotNet . Jobs ;
@@ -18,7 +16,7 @@ namespace SixLabors.ImageSharp.Benchmarks.Codecs
1816 using System . Numerics ;
1917
2018 using BenchmarkDotNet . Attributes ;
21-
19+ using BenchmarkDotNet . Diagnosers ;
2220 using SixLabors . ImageSharp . Tests ;
2321
2422 using CoreImage = ImageSharp . Image ;
@@ -30,15 +28,15 @@ public class Config : ManualConfig
3028 public Config ( )
3129 {
3230 // Uncomment if you want to use any of the diagnoser
33- this . Add ( new BenchmarkDotNet . Diagnosers . MemoryDiagnoser ( ) ) ;
31+ this . Add ( MemoryDiagnoser . Default ) ;
3432 }
3533
3634 public class ShortClr : Benchmarks . Config
3735 {
3836 public ShortClr ( )
3937 {
4038 this . Add (
41- Job . Core . WithLaunchCount ( 1 ) . WithWarmupCount ( 1 ) . WithTargetCount ( 2 )
39+ Job . Core . WithLaunchCount ( 1 ) . WithWarmupCount ( 1 ) . WithIterationCount ( 2 )
4240 ) ;
4341 }
4442 }
@@ -47,7 +45,7 @@ public ShortClr()
4745 protected Dictionary < string , byte [ ] > FileNamesToBytes = new Dictionary < string , byte [ ] > ( ) ;
4846
4947 protected Dictionary < string , Image < Rgba32 > > FileNamesToImageSharpImages = new Dictionary < string , Image < Rgba32 > > ( ) ;
50- protected Dictionary < string , System . Drawing . Bitmap > FileNamesToSystemDrawingImages = new Dictionary < string , System . Drawing . Bitmap > ( ) ;
48+ protected Dictionary < string , Bitmap > FileNamesToSystemDrawingImages = new Dictionary < string , System . Drawing . Bitmap > ( ) ;
5149
5250 /// <summary>
5351 /// The values of this enum separate input files into categories
@@ -152,7 +150,7 @@ protected void ForEachStream(Func<MemoryStream, object> operation)
152150 {
153151 foreach ( KeyValuePair < string , byte [ ] > kv in this . FileNames2Bytes )
154152 {
155- using ( MemoryStream memoryStream = new MemoryStream ( kv . Value ) )
153+ using ( var memoryStream = new MemoryStream ( kv . Value ) )
156154 {
157155 try
158156 {
@@ -179,7 +177,7 @@ protected override void ReadFilesImpl()
179177 byte [ ] bytes = kv . Value ;
180178 string fn = kv . Key ;
181179
182- using ( MemoryStream ms1 = new MemoryStream ( bytes ) )
180+ using ( var ms1 = new MemoryStream ( bytes ) )
183181 {
184182 this . FileNamesToImageSharpImages [ fn ] = CoreImage . Load < Rgba32 > ( ms1 ) ;
185183
@@ -223,7 +221,7 @@ protected void ForEachImageSharpImage(Func<Image<Rgba32>, object> operation)
223221
224222 protected void ForEachImageSharpImage ( Func < Image < Rgba32 > , MemoryStream , object > operation )
225223 {
226- using ( MemoryStream workStream = new MemoryStream ( ) )
224+ using ( var workStream = new MemoryStream ( ) )
227225 {
228226
229227 this . ForEachImageSharpImage (
0 commit comments