public ref partial struct SequenceReader<T> where T : unmanaged, System.IEquatable<T>
{
- public SequenceReader(System.Buffers.ReadOnlySequence<T> sequence);
+ public SequenceReader(in System.Buffers.ReadOnlySequence<T> sequence);
}
Drops 32-bytes of stack zeroing and this from call site
vmovdqu xmm0, qword ptr [rbx]
vmovdqu qword ptr [rbp-1D0H], xmm0
vmovdqu xmm0, qword ptr [rbx+16]
vmovdqu qword ptr [rbp-1C0H], xmm0
Its a 4 element struct so its unlikely to be covered by calling convention; however it is also an Aggressive Inline (albeit a frighteningly large one) and there has been speculation that the Jit could eventually elide the copy (@mikedn mentioned it on the ValueTaskAwaiter PR); though it doesn't currently.
@stephentoub raised the following concern dotnet/corefx#35678 (comment)
I would, however, urge us to avoid polluting methods like this with in unless we find that a) it makes a meaningful difference and b) we expect that difference will never be able to captured by JIT-level changes instead.
/cc @stephentoub @jkotas @AndyAyersMS
public ref partial struct SequenceReader<T> where T : unmanaged, System.IEquatable<T> { - public SequenceReader(System.Buffers.ReadOnlySequence<T> sequence); + public SequenceReader(in System.Buffers.ReadOnlySequence<T> sequence); }Drops 32-bytes of stack zeroing and this from call site
Its a 4 element struct so its unlikely to be covered by calling convention; however it is also an Aggressive Inline (albeit a frighteningly large one) and there has been speculation that the Jit could eventually elide the copy (@mikedn mentioned it on the ValueTaskAwaiter PR); though it doesn't currently.
@stephentoub raised the following concern dotnet/corefx#35678 (comment)
/cc @stephentoub @jkotas @AndyAyersMS