• Rick Arnold's avatar
    encoding/json: improve performance of Unmarshal on primitive types · eea0f199
    Rick Arnold authored
    Attempt 2. The first fix was much faster but ignored syntax errors.
    
    benchmark                      old ns/op    new ns/op    delta
    BenchmarkCodeEncoder            74993543     72982390   -2.68%
    BenchmarkCodeMarshal            77811181     75610637   -2.83%
    BenchmarkCodeDecoder           213337123    190144982  -10.87%
    BenchmarkCodeUnmarshal         212180972    190394852  -10.27%
    BenchmarkCodeUnmarshalReuse    202113428    182106660   -9.90%
    BenchmarkUnmarshalString            1343          919  -31.57%
    BenchmarkUnmarshalFloat64           1149          908  -20.97%
    BenchmarkUnmarshalInt64              967          778  -19.54%
    BenchmarkSkipValue              28851581     28414125   -1.52%
    
    benchmark                       old MB/s     new MB/s  speedup
    BenchmarkCodeEncoder               25.88        26.59    1.03x
    BenchmarkCodeMarshal               24.94        25.66    1.03x
    BenchmarkCodeDecoder                9.10        10.21    1.12x
    BenchmarkCodeUnmarshal              9.15        10.19    1.11x
    BenchmarkSkipValue                 69.05        70.11    1.02x
    
    Fixes #3949.
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/7231058
    eea0f199
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...