Browse Source

Add first Color benchmark [skip ci]

Former-commit-id: 006050b92f52249aa660d7ee0215782bff582c89
Former-commit-id: 79db24d98a125ff43dc80774640d0ce4e558c63a
Former-commit-id: cf230c3526bcbb1c6f54d449e0cd46458597c100
af/merge-core
James Jackson-South 10 years ago
parent
commit
e670328033
  1. 23
      tests/ImageProcessorCore.Benchmarks/Colors.cs
  2. 4
      tests/ImageProcessorCore.Benchmarks/Resize.cs
  3. 4
      tests/ImageProcessorCore.Benchmarks/project.json

23
tests/ImageProcessorCore.Benchmarks/Colors.cs

@ -0,0 +1,23 @@
using BenchmarkDotNet.Attributes;
namespace ImageProcessorCore.Benchmarks
{
using System.Drawing;
using CoreColor = ImageProcessorCore.Color;
public class Colors
{
[Benchmark(Baseline = true, Description = "System.Drawing Color")]
public bool SystemDrawingColorEqual()
{
return Color.FromArgb(128, 128, 128, 128).Equals(Color.FromArgb(128, 128, 128, 128));
}
[Benchmark(Description = "ImageProcessorCore Color")]
public bool ColorEqual()
{
return new CoreColor(.5f, .5f, .5f, .5f).Equals(new CoreColor(.5f, .5f, .5f, .5f));
}
}
}

4
tests/ImageProcessorCore.Benchmarks/Resize.cs

@ -11,7 +11,7 @@
public class Resize
{
[Benchmark(Baseline = true, Description = "System Drawing Resize")]
[Benchmark(Baseline = true, Description = "System.Drawing Resize")]
public Size ResizeSystemDrawing()
{
using (Bitmap source = new Bitmap(400, 400))
@ -31,7 +31,7 @@
}
}
[Benchmark(Description = "ImageProcessor.Core Resize")]
[Benchmark(Description = "ImageProcessorCore Resize")]
public CoreSize ResizeCore()
{
using (CoreImage image = new CoreImage(400, 400))

4
tests/ImageProcessorCore.Benchmarks/project.json

@ -1,4 +1,4 @@
{
{
"version": "1.0.0-*",
"description": "ImageProcessorCore.Benchmarks Console Application",
"authors": [ "James.South" ],
@ -12,7 +12,7 @@
"dependencies": {
"ImageProcessorCore": "1.0.0-*",
"BenchmarkDotNet": "0.9.5"
"BenchmarkDotNet": "0.9.6"
},
"commands": {

Loading…
Cancel
Save