1
0
mirror of https://github.com/golang/go synced 2024-11-06 03:16:10 -07:00
go/src
Pascal S. de Kloe df68afd07c encoding/json: reduce unmarshal mallocs for unmapped fields
JSON decoding performs poorly for unmapped and ignored fields. We noticed better
performance when unmarshalling unused fields. The loss comes mostly from calls
to scanner.error as described at #17914.

benchmark                 old ns/op     new ns/op     delta
BenchmarkIssue10335-8     431           408           -5.34%
BenchmarkUnmapped-8       1744          1314          -24.66%

benchmark                 old allocs     new allocs     delta
BenchmarkIssue10335-8     4              3              -25.00%
BenchmarkUnmapped-8       18             4              -77.78%

benchmark                 old bytes     new bytes     delta
BenchmarkIssue10335-8     320           312           -2.50%
BenchmarkUnmapped-8       568           344           -39.44%

Fixes #17914, improves #10335

Change-Id: I7d4258a94eb287c0fe49e7334795209b90434cd0
Reviewed-on: https://go-review.googlesource.com/33276
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
2017-03-20 23:58:56 +00:00
..
archive archive/zip: parallelize benchmarks 2017-03-15 18:26:51 +00:00
bufio
builtin
bytes bytes: make bytes.Buffer cache-friendly 2017-02-28 05:19:38 +00:00
cmd cmd/internal/obj: remove unneeded Addr.Node and Prog.Opt fields 2017-03-20 23:49:29 +00:00
compress Revert "all: test adjustments for the iOS builder" 2017-03-04 00:01:14 +00:00
container
context context: document that Err is unspecified before Done 2017-02-22 17:42:28 +00:00
crypto crypto/*: fix spelling of 'below' 2017-03-20 16:03:18 +00:00
database/sql database/sql: fix spelling mistake in tests 2017-03-08 18:27:19 +00:00
debug cmd/link: write dwarf sections 2017-03-01 04:51:03 +00:00
encoding encoding/json: reduce unmarshal mallocs for unmapped fields 2017-03-20 23:58:56 +00:00
errors
expvar expvar: add benchmark for (*Map).Set with per-goroutine keys 2017-03-10 19:09:48 +00:00
flag
fmt fmt: add short note about %g precision 2017-02-21 19:02:43 +00:00
go Revert "go/types: enforce Check path restrictions via panics" 2017-03-17 23:53:27 +00:00
hash hash/crc32: improve performance for ppc64le 2017-03-17 12:28:57 +00:00
html encoding/base64, html/template: fix grammar mistakes 2017-03-07 17:42:45 +00:00
image image/png: decode Gray8 transparent images. 2017-03-17 07:50:05 +00:00
index/suffixarray
internal go/internal/srcimporter: skip tests on iOS 2017-03-08 22:31:00 +00:00
io
log
math math/big: make nat.setUint64 vet-friendly 2017-03-11 00:39:23 +00:00
mime mime: handling invalid mime media parameters 2017-03-17 13:59:31 +00:00
net net/http: deflake TestServerAllowsBlockingRemoteAddr more 2017-03-20 17:32:16 +00:00
os os/user: fake Current on Android 2017-03-08 21:34:32 +00:00
path path/filepath: add test for directory junction walk 2017-02-12 23:33:01 +00:00
plugin plugin: remove unnecessary import "C" from example 2017-02-09 18:32:53 +00:00
reflect reflect: fix bucketOf to only look at ptrdata entries in gcdata 2017-02-22 02:19:48 +00:00
regexp regexp/syntax: remove unused flags parameter 2017-03-06 19:11:09 +00:00
runtime runtime: clear signal stack on main thread 2017-03-20 22:59:26 +00:00
sort sort: new example: Sorting slices with sort.SliceStable 2017-02-22 21:23:12 +00:00
strconv strconv: replace small int string table with constant string 2017-03-17 20:33:46 +00:00
strings strings: fix handling of invalid UTF-8 sequences in Map 2017-02-28 22:50:53 +00:00
sync sync/atomic: fix mipsx frame sizes 2017-02-21 18:42:47 +00:00
syscall syscall: fix linux/mipsx ret value FP offsets for Syscall9 2017-02-21 18:43:02 +00:00
testing testing: fix Benchmark() to start at 1 iteration, not 100 2017-03-01 11:06:34 +00:00
text text/template: fix method lookup on addressable nil pointer 2017-02-09 14:58:40 +00:00
time time: make the ParseInLocation test more robust 2017-03-09 18:31:42 +00:00
unicode
unsafe
vendor/golang_org/x vendor: import golang.org/x/net/proxy 2017-03-02 01:28:16 +00:00
all.bash
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash src/*.bash: use tabs consistently 2017-03-09 21:30:31 +00:00
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash *.bash: always use the same string equality operator 2017-03-14 21:46:31 +00:00
make.bash *.bash: always use the same string equality operator 2017-03-14 21:46:31 +00:00
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash *.bash: always use the same string equality operator 2017-03-14 21:46:31 +00:00
run.bat
run.rc