📷 A modern, cross-platform, 2D Graphics library for .NET
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.
 
 

25 lines
553 B

// Copyright (c) Six Labors and contributors.
// Licensed under the Apache License, Version 2.0.
using BenchmarkDotNet.Attributes;
namespace SixLabors.ImageSharp.Benchmarks.General.BasicMath
{
[LongRunJob]
public class ModuloPowerOfTwoConstant
{
private readonly int value = 42;
[Benchmark(Baseline = true)]
public int Standard()
{
return this.value % 8;
}
[Benchmark]
public int Bitwise()
{
return ImageMaths.Modulo8(this.value);
}
}
}