1
0
mirror of https://github.com/golang/go synced 2024-11-14 20:50:30 -07:00
go/src/pkg/encoding
Brad Fitzpatrick 46b4ed2cf0 encoding/json: use sync.Pool
Benchmark is within the noise. I had to run this a dozen times
each before & after (on wall power, without a browser running)
before I could get halfway consistent numbers, and even then
they jumped all over the place, with the new one sometimes
being better. But these are the best of a dozen each.

Slowdown is expected anyway, since I imagine channels are
optimized more.

benchmark                 old ns/op    new ns/op    delta
BenchmarkCodeEncoder       26556987     27291072   +2.76%
BenchmarkEncoderEncode         1069         1071   +0.19%

benchmark                  old MB/s     new MB/s  speedup
BenchmarkCodeEncoder          73.07        71.10    0.97x

benchmark                old allocs   new allocs    delta
BenchmarkEncoderEncode            2            2    0.00%

benchmark                 old bytes    new bytes    delta
BenchmarkEncoderEncode          221          221    0.00%

Update #4720

R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/37720047
2013-12-18 15:52:05 -08:00
..
ascii85 encoding/ascii85: add empty string case for Encode test 2013-12-18 08:33:59 -08:00
asn1 encoding/asn1: Fix parsing of non-printable strings in 2013-12-18 17:06:17 -05:00
base32
base64
binary encoding/binary: use bytes.Reader in read example 2013-08-27 06:32:24 -07:00
csv encoding/csv: remove unused unreadRune function 2013-12-18 13:29:27 -05:00
gob encoding/gob: do not hide an unsafe.Pointer in a uintptr 2013-12-03 15:24:27 -08:00
hex
json encoding/json: use sync.Pool 2013-12-18 15:52:05 -08:00
pem
xml encoding/xml: fix doc comment 2013-10-29 17:11:25 -04:00
encoding.go encoding: new package 2013-08-14 00:18:20 -04:00