Browse Source

simplify DecodeJpeg_ImageSpecific benchmark

pull/1773/head
Anton Firszov 5 years ago
parent
commit
c9d6556bf7
  1. 10
      tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpeg_ImageSpecific.cs
  2. 2
      tests/ImageSharp.Benchmarks/Config.cs

10
tests/ImageSharp.Benchmarks/Codecs/Jpeg/DecodeJpeg_ImageSpecific.cs

@ -44,8 +44,8 @@ namespace SixLabors.ImageSharp.Benchmarks.Codecs.Jpeg
} }
} }
[Benchmark(Baseline = true, Description = "Decode Jpeg - System.Drawing")] [Benchmark(Baseline = true)]
public SDSize JpegSystemDrawing() public SDSize SystemDrawing()
{ {
using (var memoryStream = new MemoryStream(this.jpegBytes)) using (var memoryStream = new MemoryStream(this.jpegBytes))
{ {
@ -56,12 +56,12 @@ namespace SixLabors.ImageSharp.Benchmarks.Codecs.Jpeg
} }
} }
[Benchmark(Description = "Decode Jpeg - ImageSharp")] [Benchmark]
public Size JpegImageSharp() public Size ImageSharp()
{ {
using (var memoryStream = new MemoryStream(this.jpegBytes)) using (var memoryStream = new MemoryStream(this.jpegBytes))
{ {
using (var image = Image.Load<Rgba32>(memoryStream, new JpegDecoder { IgnoreMetadata = true })) using (var image = Image.Load(memoryStream, new JpegDecoder { IgnoreMetadata = true }))
{ {
return new Size(image.Width, image.Height); return new Size(image.Width, image.Height);
} }

2
tests/ImageSharp.Benchmarks/Config.cs

@ -33,7 +33,6 @@ namespace SixLabors.ImageSharp.Benchmarks
{ {
public MultiFramework() => this.AddJob( public MultiFramework() => this.AddJob(
Job.Default.WithRuntime(ClrRuntime.Net472), Job.Default.WithRuntime(ClrRuntime.Net472),
Job.Default.WithRuntime(CoreRuntime.Core21),
Job.Default.WithRuntime(CoreRuntime.Core31)); Job.Default.WithRuntime(CoreRuntime.Core31));
} }
@ -41,7 +40,6 @@ namespace SixLabors.ImageSharp.Benchmarks
{ {
public ShortMultiFramework() => this.AddJob( public ShortMultiFramework() => this.AddJob(
Job.Default.WithRuntime(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3), Job.Default.WithRuntime(ClrRuntime.Net472).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3),
Job.Default.WithRuntime(CoreRuntime.Core21).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3),
Job.Default.WithRuntime(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3)); Job.Default.WithRuntime(CoreRuntime.Core31).WithLaunchCount(1).WithWarmupCount(3).WithIterationCount(3));
} }

Loading…
Cancel
Save