Browse Source

InliningOptions.ShortMethod

pull/768/head
Anton Firszov 8 years ago
parent
commit
b5e419d89e
  1. 4
      src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs
  2. 4
      src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt
  3. 10
      tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs

4
src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.cs

@ -17,7 +17,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
/// Transpose the block into the destination block.
/// </summary>
/// <param name="d">The destination block</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(InliningOptions.ShortMethod)]
public void TransposeInto(ref Block8x8F d)
{
d.V0L.X = V0L.X;
@ -119,7 +119,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
/// <summary>
/// AVX2-only variant for executing <see cref="NormalizeColorsInplace"/> and <see cref="RoundInplace"/> in one step.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(InliningOptions.ShortMethod)]
public void NormalizeColorsAndRoundInplaceAvx2()
{
Vector<float> off = new Vector<float>(128f);

4
src/ImageSharp/Formats/Jpeg/Components/Block8x8F.Generated.tt

@ -30,7 +30,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
/// Transpose the block into the destination block.
/// </summary>
/// <param name="d">The destination block</param>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(InliningOptions.ShortMethod)]
public void TransposeInto(ref Block8x8F d)
{
<#
@ -82,7 +82,7 @@ namespace SixLabors.ImageSharp.Formats.Jpeg.Components
/// <summary>
/// AVX2-only variant for executing <see cref="NormalizeColorsInplace"/> and <see cref="RoundInplace"/> in one step.
/// </summary>
[MethodImpl(MethodImplOptions.AggressiveInlining)]
[MethodImpl(InliningOptions.ShortMethod)]
public void NormalizeColorsAndRoundInplaceAvx2()
{
Vector<float> off = new Vector<float>(128f);

10
tests/ImageSharp.Tests/Formats/Jpg/JpegProfilingBenchmarks.cs

@ -24,21 +24,21 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
public static readonly TheoryData<string> DecodeJpegData = new TheoryData<string>()
{
TestImages.Jpeg.Baseline.Cmyk,
TestImages.Jpeg.Baseline.Ycck,
//TestImages.Jpeg.Baseline.Cmyk,
//TestImages.Jpeg.Baseline.Ycck,
TestImages.Jpeg.Baseline.Calliphora,
TestImages.Jpeg.Baseline.Jpeg400,
TestImages.Jpeg.Baseline.Jpeg420Exif,
TestImages.Jpeg.Baseline.Jpeg444,
};
// [Theory] // Benchmark, enable manually
// [MemberData(nameof(DecodeJpegData))]
[Theory] // Benchmark, enable manually
[MemberData(nameof(DecodeJpegData))]
public void DecodeJpeg(string fileName)
{
this.DecodeJpegBenchmarkImpl(fileName, new JpegDecoder());
}
private void DecodeJpegBenchmarkImpl(string fileName, IImageDecoder decoder)
{
// do not run this on CI even by accident

Loading…
Cancel
Save