aboutsummaryrefslogtreecommitdiff
path: root/src/encoding/binary
diff options
context:
space:
mode:
authorKeith Randall <khr@golang.org>2022-03-06 12:07:54 -0800
committerKeith Randall <khr@google.com>2022-04-14 21:16:11 +0000
commit3d8cb26504f9e3f5b45b4ea97b55714a25e016c1 (patch)
tree3520fe5dda3bb7a68f0887cc2f6e7fd671ce4231 /src/encoding/binary
parent01b9ae22ed3c0f9c9ea29adbcd23bd97de6d18dd (diff)
downloadgo-3d8cb26504f9e3f5b45b4ea97b55714a25e016c1.tar.xz
cmd/compile: modify switches of strings to use jump table for lengths
Reorganize the way we rewrite expression switches on strings, so that jump tables are naturally used for the outer switch on the string length. The changes to the prove pass in this CL are required so as to not repeat the test for string length in each case. name old time/op new time/op delta SwitchStringPredictable 2.28ns ± 9% 2.08ns ± 5% -9.04% (p=0.000 n=10+10) SwitchStringUnpredictable 10.5ns ± 1% 9.5ns ± 1% -9.08% (p=0.000 n=9+10) Update #5496 Update #34381 Change-Id: Ie6846b1dd27f3e472f7c30dfcc598c68d440b997 Reviewed-on: https://go-review.googlesource.com/c/go/+/395714 Run-TryBot: Keith Randall <khr@golang.org> TryBot-Result: Gopher Robot <gobot@golang.org> Reviewed-by: Cherry Mui <cherryyz@google.com> Reviewed-by: Keith Randall <khr@google.com>
Diffstat (limited to 'src/encoding/binary')
0 files changed, 0 insertions, 0 deletions