ReadOnlyMemory{T}.Span is slower than you'd expect (even on modern .NET) because it holds an object reference and every call to Span must figure out what kind of object it is (there are three cases). This type exists to speed up that property in the usual case that it's an array.
More...
Source file:
ReadOnlyMemory{T}.Span is slower than you'd expect (even on modern .NET) because it holds an object reference and every call to Span must figure out what kind of object it is (there are three cases). This type exists to speed up that property in the usual case that it's an array.
|
|
readonly ReadOnlyMemory< T > | _mem |
| |
|
readonly T[] | _array |
| |
|
readonly int | _arrayOffset |
| |
| ReadOnlyMemory< T > | Memory => _mem |
| | The underlying ReadOnlyMemory{T}. More...
|
| |
|
|
ReadOnlySpan< T > | Span [get, set] |
| |
|
int | Length [get] |
| |
|
|
| ReadOnlyMemory2 (ReadOnlyMemory< T > mem) |
| |
|
ReadOnlyMemory< T > | Slice (int start) |
| |
|
ReadOnlyMemory< T > | Slice (int start, int length) |
| |
|
T[] | ToArray () |
| |
|
|
static implicit | operator ReadOnlyMemory2< T > (ReadOnlyMemory< T > mem) |
| |
| ReadOnlyMemory<T> ReadOnlyMemory2< T >.Memory => _mem |
The underlying ReadOnlyMemory{T}.