]> Cypherpunks repositories - gostls13.git/commit
encoding/gob: make encoding structs a little faster
authorRob Pike <r@golang.org>
Wed, 15 Oct 2014 03:03:35 +0000 (20:03 -0700)
committerRob Pike <r@golang.org>
Wed, 15 Oct 2014 03:03:35 +0000 (20:03 -0700)
commitae250ab227311aab7fd8dff22ae05592abd13bde
tree33261b064848a851ade484e76bf61eb42d358f06
parentfe8f799ef7b0124ff0a50f5ec590a70ad20d6ef2
encoding/gob: make encoding structs a little faster
FieldByIndex never returns an invalid Value, so the validity
test can be avoided if the field is not indirect.

BenchmarkGobEncode     12768642      12424022      -2.70%
BenchmarkGobEncode     60.11        61.78        1.03x

LGTM=rsc
R=rsc
CC=golang-codereviews
https://golang.org/cl/158890045
src/encoding/gob/encode.go