• 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
api Loading commit data...
doc Loading commit data...
include Loading commit data...
lib Loading commit data...
misc Loading commit data...
src Loading commit data...
test Loading commit data...
.hgignore Loading commit data...
.hgtags Loading commit data...
AUTHORS Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
PATENTS Loading commit data...
README Loading commit data...
favicon.ico Loading commit data...
robots.txt Loading commit data...