One of the interesting changes (not sure why Microsoft changed this) was moving/changing the Span<T> API's a bit. For example, the Span<T>.NonPortableCast Method was moved as an extension method under MemoryMarshal. Previous API Current API Similarly, the string.AsReadonlySpan method has been renamed. The new API is as follows. Previous API Current API The MemoryMarshal extensions … Continue reading Updated Span API : NonPortableCast and AsReadOnlySpan to MemoryMarshal.Cast and AsSpan
Tag: Span
Type Casting using Span<T>
In an earlier post, we explored the possibilities of Span and performance benefits of the feature was clearly visible in our benchmark tests. We will continue exploring the Span further in this post, as attempt to cast between types using Span. The cast functionality is not that hard, thanks to the extension methods that comes … Continue reading Type Casting using Span<T>
Benchmarking Span<T> Performance
Span<T> is yet another addition to C# 7.x and is particularly useful in developing memory intensive applications. So what is Span all about ? As Microsoft describes it, Span<T> is a new value Type which enables the representation of contiguous regions of arbitrary memory, regardless of whether the memory is associated with a managed … Continue reading Benchmarking Span<T> Performance