go/src/encoding
Joe Tsai 67f7e16bcc encoding/gob: optimize decoding of []byte
The reflect.Value.Slice method unfortunately allocates every time
since it needs to place the slice header on the heap.
This is silly since gob immediately stores the result back into slice.
Instead, use the reflect.Value.SetLen method.

DecodeBytesSlice  75.0µs ± 2%  35.2µs ± 6%  -53.02%

Change-Id: I3ca0529d01bf978f2b76e215f52d369f458951ef
Reviewed-on: https://go-review.googlesource.com/c/go/+/345572
Trust: Joe Tsai <joetsai@digital-static.net>
Run-TryBot: Joe Tsai <joetsai@digital-static.net>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Rob Pike <r@golang.org>
2021-08-27 08:01:41 +00:00
..
ascii85 all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
asn1 all: remove redundant spaces before . and , 2021-04-20 00:49:17 +00:00
base32 all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
base64 all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
binary encoding/binary: limit bytes read by Uvarint to <= 10 2021-03-08 18:49:14 +00:00
csv encoding/csv: add FieldPos method 2021-04-29 17:47:48 +00:00
gob encoding/gob: optimize decoding of []byte 2021-08-27 08:01:41 +00:00
hex all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
json encoding/json: fix package shadowing in MarshalIndent example 2021-03-14 19:58:14 +00:00
pem all: update references to symbols moved from io/ioutil to io 2020-10-20 18:41:18 +00:00
xml encoding/xml: replace comments inside directives with a space 2021-03-15 20:04:23 +00:00
encoding.go