From my perspective, it seems like something that'll be used in the guts of ASP.NET and the rest of the base class library that will benefit the performance of my code, but I'd never really use it directly.
From my perspective, it seems like something that'll be used in the guts of ASP.NET and the rest of the base class library that will benefit the performance of my code, but I'd never really use it directly.
The real selling point is that Span is much more flexible than an Array. Both Managed and Unmanged memory can work with it. If you load a big string and need to get each line from it, you can slice into the middle of the string safely and get a ReadOnlySpan<char> that supports most 'string' operations without allocating any memory.
Or imagine you need to process some huge file, typically you would read it chunk by chunk copying the data from the Stream into some byte[]. But with Span you could open a Memory Mapped File and work on segments of the file without copying into temp buffers.
You gain a lot by avoiding memory copies and by allocating fewer objects (less work for the GC). For some workloads then can be a huge speedup.
Also it means you can now pass readonly arrays (the elements) to things using ReadOnlySpan<T>; so don't have to do defensive copies
Tons of reasons to use them besides performance. We use them for those reasons and if there is a performance boon, great bonus!