]> Cypherpunks repositories - gostls13.git/commit
gob: avoid one copy for every message written.
authorRob Pike <r@golang.org>
Mon, 10 Oct 2011 19:38:49 +0000 (12:38 -0700)
committerRob Pike <r@golang.org>
Mon, 10 Oct 2011 19:38:49 +0000 (12:38 -0700)
commitc832ecf03eb5df16949b785ac017eb2dcb205ba1
treeb62176133c560dd61e310d951f93046f3f002ee0
parentc9dd2e41b14e8ef4867fda5b4daf2d7b5916c776
gob: avoid one copy for every message written.
Plus the need for a second in-memory buffer.
Plays a bit fast and loose with the contents of a byte buffer,
but saves a potentially huge allocation. The gotest
run is about 10% faster overall after this change.

R=golang-dev, r, gri
CC=golang-dev
https://golang.org/cl/5236043
src/pkg/gob/encode.go
src/pkg/gob/encoder.go