• Brad Fitzpatrick's avatar
    encoding/json: use sync.Pool · 46b4ed2c
    Brad Fitzpatrick authored
    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
    46b4ed2c
Name
Last commit
Last update
..
archive Loading commit data...
bufio Loading commit data...
builtin Loading commit data...
bytes Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
database/sql Loading commit data...
debug Loading commit data...
encoding Loading commit data...
errors Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
hash Loading commit data...
html Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
io Loading commit data...
log Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
os Loading commit data...
path Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
runtime Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
testing Loading commit data...
text Loading commit data...
time Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...