]> Cypherpunks repositories - gostls13.git/commit
encoding/binary: fast path for reading slices
authorRob Pike <r@golang.org>
Fri, 9 Aug 2013 22:40:32 +0000 (08:40 +1000)
committerRob Pike <r@golang.org>
Fri, 9 Aug 2013 22:40:32 +0000 (08:40 +1000)
commit1f25f5ad48b61092bdd8f43af7c068db0e947363
tree5554a67851a89fc1a7905b2319c0bcc42388652c
parentd9f93b0e0b351de6cfe05c03d8e8f78328178407
encoding/binary: fast path for reading slices

Again, it still allocates but the code is simple.

benchmark                       old ns/op    new ns/op    delta
BenchmarkReadSlice1000Int32s        35580        11465  -67.78%

benchmark                        old MB/s     new MB/s  speedup
BenchmarkReadSlice1000Int32s       112.42       348.86    3.10x

R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/12694048
src/pkg/encoding/binary/binary.go