YUNOVA · C# · Module 12: Advanced C#

Span<T> and memory performance

Notes for offline study · 30 November 2026

Span<T> and memory performance

Key points

  • Span<T> is a view over contiguous memory without copying it.
  • Slicing a span avoids new allocations for substrings or arrays.
  • Span is a ref struct, so it cannot be stored on the heap; Memory<T> can.

Free on YUNOVA · yunova.in · Sign in to add your own lesson notes to this sheet.