diff options
| author | Keith Randall <khr@golang.org> | 2023-09-01 20:32:07 -0700 |
|---|---|---|
| committer | Keith Randall <khr@golang.org> | 2023-10-06 15:42:30 +0000 |
| commit | 28f4ea16a240af6c5a417e20be77745329f817f1 (patch) | |
| tree | a298be53ac70ba58b561a023c8ec41d2e16e8dfc /src/encoding/json/encode_test.go | |
| parent | 10da3b64af1aebfd146fa3b7ecf765ee1b0f0d7d (diff) | |
| download | go-28f4ea16a240af6c5a417e20be77745329f817f1.tar.xz | |
cmd/compile: improve interface type switches
For type switches where the targets are interface types,
call into the runtime once instead of doing a sequence
of assert* calls.
name old time/op new time/op delta
SwitchInterfaceTypePredictable-24 26.6ns ± 1% 25.8ns ± 2% -2.86% (p=0.000 n=10+10)
SwitchInterfaceTypeUnpredictable-24 39.3ns ± 1% 37.5ns ± 2% -4.57% (p=0.000 n=10+10)
Not super helpful by itself, but this code organization allows
followon CLs that add caching to the lookups.
Change-Id: I7967f85a99171faa6c2550690e311bea8b54b01c
Reviewed-on: https://go-review.googlesource.com/c/go/+/526657
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/encoding/json/encode_test.go')
0 files changed, 0 insertions, 0 deletions
