From ffef3ecd147d2a30bdfeecdde28bf3ebd53a080e Mon Sep 17 00:00:00 2001 From: Jason Nelson Date: Fri, 23 Mar 2018 10:33:06 -0700 Subject: [PATCH] Benchmark removed SpanUtility logic inplace --- .../General/Vectorization/VectorFetching.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs b/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs index 147f66f8f..aa7d926a4 100644 --- a/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs +++ b/tests/ImageSharp.Benchmarks/General/Vectorization/VectorFetching.cs @@ -3,7 +3,7 @@ namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization using System; using System.Numerics; using System.Runtime.CompilerServices; - + using System.Runtime.InteropServices; using BenchmarkDotNet.Attributes; using SixLabors.ImageSharp.Memory; @@ -90,13 +90,13 @@ namespace SixLabors.ImageSharp.Benchmarks.General.Vectorization } [Benchmark] - public void FetchWithSpanUtility() + public void FetchWithUnsafeCastFromReference() { - Vector v = new Vector(this.testValue); + var v = new Vector(this.testValue); - Span span = new Span(this.data); + var span = new Span(this.data); - ref Vector start = ref span.FetchVector(); + ref Vector start = ref Unsafe.As>(ref MemoryMarshal.GetReference(span)); int n = this.InputSize / Vector.Count;