Descriptionio: Prioritize WriterTos over ReaderFroms in Copy.
This only affects calls where both ReaderFrom and WriterTo are implemented. WriterTo can issue one large write, while ReaderFrom must Read until EOF, potentially reallocating when out of memory. With one large Write, the Writer only needs to allocate once.
This also helps in ioutil.Discard since we can avoid copying memory when the Reader implements WriterTo.
Patch Set 1 #Patch Set 2 : diff -r 4e860d4a312b https://code.google.com/p/go/ #Patch Set 3 : diff -r 4e860d4a312b https://code.google.com/p/go/ #
Total comments: 2
Patch Set 4 : diff -r 4e860d4a312b https://code.google.com/p/go/ #Patch Set 5 : diff -r 0fb55e40bd0c https://code.google.com/p/go/ #MessagesTotal messages: 8
|