aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/encode.go
diff options
context:
space:
mode:
authorJoe Tsai <joetsai@digital-static.net>2023-02-23 13:28:48 -0800
committerGopher Robot <gobot@golang.org>2023-02-27 17:29:42 +0000
commitcb3e170ae764856a99160ee1a6cf8f04c8f51e5d (patch)
treea2ede3504026a866b4f4ecb49acf7476b75a36bc /src/encoding/json/encode.go
parent8367e2dfc72f626cba75be71112d42fdb2ed82f7 (diff)
downloadgo-cb3e170ae764856a99160ee1a6cf8f04c8f51e5d.tar.xz
encoding/json: rely on reflect.Value.SetZero
v.SetZero() is faster than v.Set(reflect.Zero(v.Type())) and was recently added in Go 1.20. Benchmark numbers are largely unchanged since this mainly affects the unmarshaling of large numbers of JSON nulls, which our benchmarks do not heavily exercise. Change-Id: I464f60f63c9027e63a99fd5da92e7ab782018329 Reviewed-on: https://go-review.googlesource.com/c/go/+/471195 Reviewed-by: Johan Brandhorst-Satzkorn <johan.brandhorst@gmail.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Than McIntosh <thanm@google.com> Run-TryBot: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Dmitri Shuralyov <dmitshur@google.com> Auto-Submit: Joseph Tsai <joetsai@digital-static.net> Reviewed-by: Daniel Martí <mvdan@mvdan.cc>
Diffstat (limited to 'src/encoding/json/encode.go')
0 files changed, 0 insertions, 0 deletions