Prior to this change, each call to Stream.Write() would allocate 1 or
more *bytes.Reader instances. While these are small, it makes the Go
garbage collector do unnecessary work.
Besides the inefficiency at the machine level, it also makes no sense
at the human level to create an io.Reader and use io.Copy when a
single Write() call suffices.
Prior to this change, each call to Stream.Write() would allocate 1 or more *bytes.Reader instances. While these are small, it makes the Go garbage collector do unnecessary work.
Besides the inefficiency at the machine level, it also makes no sense at the human level to create an io.Reader and use io.Copy when a single Write() call suffices.