go/src/encoding
Daniel Martí cb6646234c encoding/json: use SetBytes in UnmarshalReuse benchmark
This was the only benchmark missing the SetBytes call, as spotted
earlier by Bryan.

It's not required to make the benchmark useful, but it can still be a
good way to see how its speed is affected by the reduced allocations:

name                  time/op
CodeUnmarshal-8        12.1ms ± 1%
CodeUnmarshalReuse-8   11.4ms ± 1%

name                  speed
CodeUnmarshal-8       161MB/s ± 1%
CodeUnmarshalReuse-8  171MB/s ± 1%

name                  alloc/op
CodeUnmarshal-8        3.28MB ± 0%
CodeUnmarshalReuse-8   1.94MB ± 0%

name                  allocs/op
CodeUnmarshal-8         92.7k ± 0%
CodeUnmarshalReuse-8    77.6k ± 0%

While at it, remove some unnecessary empty lines.

Change-Id: Ib2bd92d5b3237b8f3092e8c6f863dab548fee2f5
Reviewed-on: https://go-review.googlesource.com/c/go/+/170938
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2019-04-05 20:54:50 +00:00
..
ascii85 encoding/ascii85: make bigtest big again 2017-06-23 14:28:30 +00:00
asn1 all: use "reports whether" consistently in the few places that didn't 2018-11-02 22:47:58 +00:00
base32 encoding/base32: remove ineffectual assignment in test 2019-03-02 02:14:45 +00:00
base64 encoding/base64: speed up the decoder 2019-03-13 10:39:58 +00:00
binary encoding/binary: simplify Read and Write 2018-09-04 14:52:30 +00:00
csv encoding/csv: document that Writer is buffered 2019-03-04 05:47:35 +00:00
gob encoding/gob: update documentation in doc.go for wireType 2019-03-08 03:57:49 +00:00
hex encoding/hex: simplify encoder arithmetic 2019-03-05 17:40:09 +00:00
json encoding/json: use SetBytes in UnmarshalReuse benchmark 2019-04-05 20:54:50 +00:00
pem encoding/pem: skip whitespace work on most inputs 2019-03-02 20:43:08 +00:00
xml encoding/xml, encoding/json: docs and examples using custom marshalers 2018-12-12 14:18:06 +00:00
encoding.go all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00