Is your feature request related to a problem? Please describe.
Channels are used to efficiently pass data through the protocol stack, they are queues of byte chunks and copy happens only when API does not allow working with ReadOnlySequence. Still they need several improvements:
initially allocate data in consistent way
de-allocate data when it's read
when the data is being materialized, provide access to underlying spans, to cover more use cases?
detect leaks and de-allocate data that will not be read for sure
Describe the solution you'd like
Measure current memory allocations and determine the current level of efficiency, if it's worth it:
Is your feature request related to a problem? Please describe. Channels are used to efficiently pass data through the protocol stack, they are queues of byte chunks and copy happens only when API does not allow working with ReadOnlySequence. Still they need several improvements:
Describe the solution you'd like
Describe alternatives you've considered TBD
Additional context How it's now: