mirror of https://github.com/SixLabors/ImageSharp
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
40 lines
1.1 KiB
40 lines
1.1 KiB
// <copyright file="DecodeJpegMultiple.cs" company="James Jackson-South">
|
|
// Copyright (c) James Jackson-South and contributors.
|
|
// Licensed under the Apache License, Version 2.0.
|
|
// </copyright>
|
|
|
|
namespace ImageSharp.Benchmarks.Image
|
|
{
|
|
using System.Collections.Generic;
|
|
using BenchmarkDotNet.Attributes;
|
|
|
|
using CoreImage = ImageSharp.Image;
|
|
|
|
[Config(typeof(Config.Short))]
|
|
public class DecodeJpegMultiple : MultiImageBenchmarkBase
|
|
{
|
|
protected override IEnumerable<string> InputImageSubfoldersOrFiles => new[]
|
|
{
|
|
"Jpg/"
|
|
};
|
|
|
|
protected override IEnumerable<string> SearchPatterns => new[] { "*.jpg" };
|
|
|
|
[Benchmark(Description = "DecodeJpegMultiple - ImageSharp")]
|
|
public void DecodeJpegImageSharp()
|
|
{
|
|
this.ForEachStream(
|
|
ms => CoreImage.Load<Rgba32>(ms)
|
|
);
|
|
}
|
|
|
|
[Benchmark(Baseline = true, Description = "DecodeJpegMultiple - System.Drawing")]
|
|
public void DecodeJpegSystemDrawing()
|
|
{
|
|
this.ForEachStream(
|
|
System.Drawing.Image.FromStream
|
|
);
|
|
}
|
|
|
|
}
|
|
}
|