spdystream icon indicating copy to clipboard operation
spdystream copied to clipboard

Make spdystream.Stream implement io.WriteTo or io.ReaderFrom interface

Open BrianBland opened this issue 10 years ago • 0 comments

io.Copy currently copies in chunks of 3KB for standard io.Writer and io.Reader implementations, but will instead use io.WriteTo or io.ReadFrom if the writer or reader supports the relevant method. To improve the performance of copying to/from spdystream.Stream, we can tweak the chunk size by implementing these methods.

We currently use io.Copy for spdystream.Stream in docker/libchan to handle transparent stream passing, so this could potentially improve the performance of libchan over spdy.

See io.Copy source for reference.

BrianBland avatar Oct 25 '14 00:10 BrianBland