Steven Giesel 6/8/2023

Span / Memory / ReadOnlySequence in C#

Read Original

This technical article details the purpose and performance characteristics of Span<T>, Memory<T>, and ReadOnlySequence<T> in C#. It compares these types, explaining that Span<T> is a stack-only, high-performance accessor for contiguous memory, while Memory<T> is a heap-allocated type usable in async contexts. The guide covers their trade-offs, optimization scenarios, and appropriate use cases for modern .NET development.

Span / Memory / ReadOnlySequence in C#

Comments

No comments yet

Be the first to share your thoughts!

Browser Extension

Get instant access to AllDevBlogs from your browser

Top of the Week