-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Optimize writing single segment sequences #24929
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
What kinda gains are you seeing? |
| } | ||
|
|
||
| [MethodImpl(MethodImplOptions.AggressiveInlining)] | ||
| public static void CopyTo(in this ReadOnlySequence<byte> buffer, PipeWriter pipeWriter) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe we should add this to ReadOnlySequence the target would be an IBufferWriter
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add it to runtime? Could do. It has this today:
public static class BuffersExtensions
{
public static void Write<T>(this IBufferWriter<T> writer, ReadOnlySpan<T> value)
{
}
}There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
|
Put this in the RC1 branch |

Avoid foreach over
ReadOnlySequence<byte>when it is a single segment.