]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: simplify allocation in decode.
authorRob Pike <r@golang.org>
Mon, 30 Jun 2014 22:47:11 +0000 (15:47 -0700)
committerRob Pike <r@golang.org>
Mon, 30 Jun 2014 22:47:11 +0000 (15:47 -0700)
commitce5bbfdde4ac3e2b8b1437e3ff12c69daec938a7
tree7996a380dd50e4b919a18a1e708f271943b61c7e
parent6a228239392fd4f3a3d04c816be4fdd39d3a36b1
encoding/gob: simplify allocation in decode.
The old code's structure needed to track indirections because of the
use of unsafe. That is no longer necessary, so we can remove all
that tracking. The code cleans up considerably but is a little slower.
We may be able to recover that performance drop. I believe the
code quality improvement is worthwhile regardless.

BenchmarkEndToEndPipe           5610          5780          +3.03%
BenchmarkEndToEndByteBuffer     3156          3222          +2.09%

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/103700043
src/pkg/encoding/gob/codec_test.go
src/pkg/encoding/gob/decode.go