diff options
| author | erifan01 <eric.fang@arm.com> | 2018-04-17 07:37:38 +0000 |
|---|---|---|
| committer | Cherry Zhang <cherryyz@google.com> | 2018-04-24 20:21:08 +0000 |
| commit | d4e936cfd622de322dc93f69144c68bb4c133e21 (patch) | |
| tree | 4b4fe7a1b9308d7673ae8447c102cb4ef3b67cdc /src/cmd | |
| parent | 5d4267e4803436e17b87e88b13dc79e528299634 (diff) | |
| download | go-d4e936cfd622de322dc93f69144c68bb4c133e21.tar.xz | |
internal/bytealg: optimize IndexString on arm64
This CL adjusts the order of the branch instructions of the
code to make it easier for the LIKELY branch to happen.
Benchmarks:
name old time/op new time/op delta
pkg:strings goos:linux goarch:arm64
IndexHard2-8 2.17ms ± 1% 1.23ms ± 0% -43.34% (p=0.008 n=5+5)
CountHard2-8 2.13ms ± 1% 1.21ms ± 2% -43.31% (p=0.008 n=5+5)
pkg:bytes goos:linux goarch:arm64
IndexRune/4M-8 661µs ±22% 513µs ± 0% -22.32% (p=0.008 n=5+5)
IndexEasy/4M-8 672µs ±23% 513µs ± 0% -23.71% (p=0.016 n=5+4)
Change-Id: Ib96f095edf77747edc8a971e79f5c1428e5808ce
Reviewed-on: https://go-review.googlesource.com/109015
Reviewed-by: Cherry Zhang <cherryyz@google.com>
Run-TryBot: Cherry Zhang <cherryyz@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Diffstat (limited to 'src/cmd')
0 files changed, 0 insertions, 0 deletions
