aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/json/encode.go
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2023-08-17 14:20:21 -0700
committerGopher Robot <gobot@golang.org>2023-08-23 00:30:54 +0000
commit47112996619da0683eb15e611a1e2df85416feee (patch)
treefaba836b45c89df8eb42a3269acda1f92ffb447c /src/encoding/json/encode.go
parent556e9c5f3e28d0398001384508a3c51143adcff8 (diff)
downloadgo-47112996619da0683eb15e611a1e2df85416feee.tar.xz
cmd/compile: use jump tables for large type switches
For large interface -> concrete type switches, we can use a jump table on some bits of the type hash instead of a binary search on the type hash. name old time/op new time/op delta SwitchTypePredictable-24 1.99ns ± 2% 1.78ns ± 5% -10.87% (p=0.000 n=10+10) SwitchTypeUnpredictable-24 11.0ns ± 1% 9.1ns ± 2% -17.55% (p=0.000 n=7+9) Change-Id: Ida4768e5d62c3ce1c2701288b72664aaa9e64259 Reviewed-on: https://go-review.googlesource.com/c/go/+/521497 Reviewed-by: Keith Randall <khr@google.com> Auto-Submit: Keith Randall <khr@google.com> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Run-TryBot: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/encoding/json/encode.go')
0 files changed, 0 insertions, 0 deletions