Updated Span API : NonPortableCast and AsReadOnlySpan to MemoryMarshal.Cast and AsSpan

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

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