From 3da4b43d906464cb64e6f788330f2a128a640781 Mon Sep 17 00:00:00 2001 From: James Jackson-South Date: Thu, 19 Jan 2017 21:24:07 +1100 Subject: [PATCH] Add modulus benchmark --- .../ImageSharp.Benchmarks/General/Modulus.cs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/ImageSharp.Benchmarks/General/Modulus.cs diff --git a/tests/ImageSharp.Benchmarks/General/Modulus.cs b/tests/ImageSharp.Benchmarks/General/Modulus.cs new file mode 100644 index 0000000000..aa3e461e1c --- /dev/null +++ b/tests/ImageSharp.Benchmarks/General/Modulus.cs @@ -0,0 +1,19 @@ +namespace ImageSharp.Benchmarks.General +{ + using BenchmarkDotNet.Attributes; + + public class Modulus + { + [Benchmark(Baseline = true, Description = "Standard Modulus using %")] + public int StandardModulus() + { + return 255 % 256; + } + + [Benchmark(Description = "Bitwise Modulus using &")] + public int BitwiseModulus() + { + return 255 & 255; + } + } +}