• Brad Fitzpatrick's avatar
    encoding/json: allocate less in NewEncoder · f1583bb9
    Brad Fitzpatrick authored
    The *Encoder is almost always garbage. It doesn't need an
    encodeState inside of it (and its bytes.Buffer), since it's
    only needed locally inside of Encode.
    
    benchmark                 old ns/op    new ns/op    delta
    BenchmarkEncoderEncode         2562         2553   -0.35%
    
    benchmark                 old bytes    new bytes    delta
    BenchmarkEncoderEncode          283          102  -63.96%
    
    R=r
    CC=gobot, golang-dev
    https://golang.org/cl/9365044
    f1583bb9
Name
Last commit
Last update
..
ascii85 Loading commit data...
asn1 Loading commit data...
base32 Loading commit data...
base64 Loading commit data...
binary Loading commit data...
csv Loading commit data...
gob Loading commit data...
hex Loading commit data...
json Loading commit data...
pem Loading commit data...
xml Loading commit data...