]> Cypherpunks repositories - gostls13.git/commit
gob: use bufio on the decode to avoid a system call on each read.
authorRob Pike <r@golang.org>
Sat, 12 Mar 2011 00:24:09 +0000 (16:24 -0800)
committerRob Pike <r@golang.org>
Sat, 12 Mar 2011 00:24:09 +0000 (16:24 -0800)
commit5df1cf0475cd5b27601cfe95d94c5e4365f999f3
treed728071a78a676f54bd36c07ba5fb93e6a3f8391
parentc734b50b11c6d9e46856c51870dc4bee94b8f18c
gob: use bufio on the decode to avoid a system call on each read.
Add a benchmark.
BenchmarkEndToEndPipe gives 14.3microseconds/op before,
13.1microseconds/op after, or about 76e3 round trips per second
through the kernel.
With a bytes buffer, and therefore no system calls for I/O, the
numbers go to 7.3microseconds/op, or about 137e3 round trips
per second.

R=rsc
CC=golang-dev
https://golang.org/cl/4279045
src/pkg/gob/decoder.go
src/pkg/gob/encoder_test.go