1
0
mirror of https://github.com/golang/go synced 2024-10-05 21:21:21 -06:00
go/src/strings
Ilya Tocar 95333aea53 strings: add asm version of Index() for short strings on amd64
Currently we have special case for 1-byte strings,
This extends this to strings shorter than 32 bytes on amd64.
Results (broadwell):

name                 old time/op  new time/op  delta
IndexRune-4          57.4ns ± 0%  57.5ns ± 0%   +0.10%        (p=0.000 n=20+19)
IndexRuneFastPath-4  20.4ns ± 0%  20.4ns ± 0%     ~     (all samples are equal)
Index-4              21.0ns ± 0%  21.8ns ± 0%   +3.81%        (p=0.000 n=20+20)
LastIndex-4          7.07ns ± 1%  6.98ns ± 0%   -1.21%        (p=0.000 n=20+16)
IndexByte-4          18.3ns ± 0%  18.3ns ± 0%     ~     (all samples are equal)
IndexHard1-4         1.46ms ± 0%  0.39ms ± 0%  -73.06%        (p=0.000 n=16+16)
IndexHard2-4         1.46ms ± 0%  0.30ms ± 0%  -79.55%        (p=0.000 n=18+18)
IndexHard3-4         1.46ms ± 0%  0.66ms ± 0%  -54.68%        (p=0.000 n=19+19)
LastIndexHard1-4     1.46ms ± 0%  1.46ms ± 0%   -0.01%        (p=0.036 n=18+20)
LastIndexHard2-4     1.46ms ± 0%  1.46ms ± 0%     ~           (p=0.588 n=19+19)
LastIndexHard3-4     1.46ms ± 0%  1.46ms ± 0%     ~           (p=0.283 n=17+20)
IndexTorture-4       11.1µs ± 0%  11.1µs ± 0%   +0.01%        (p=0.000 n=18+17)

Change-Id: I892781549f558f698be4e41f9f568e3d0611efb5
Reviewed-on: https://go-review.googlesource.com/16430
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Ilya Tocar <ilya.tocar@intel.com>
2015-11-03 16:04:28 +00:00
..
compare_test.go strings: add Compare(x, y string) int, for symmetry with bytes.Compare 2015-01-15 17:17:05 +00:00
compare.go strings: remove overengineered Compare implementation 2015-01-19 02:19:17 +00:00
example_test.go strings: Add examples for HasPrefix and HasSuffix 2015-10-23 01:57:15 +00:00
export_test.go
reader_test.go bytes, strings: add Reader.Size methods 2015-04-06 08:53:47 +00:00
reader.go bytes, strings: add Reader.Size methods 2015-04-06 08:53:47 +00:00
replace_test.go
replace.go
search_test.go
search.go
strings_amd64.go strings: add asm version of Index() for short strings on amd64 2015-11-03 16:04:28 +00:00
strings_decl.go strings: remove overengineered Compare implementation 2015-01-19 02:19:17 +00:00
strings_generic.go strings: add asm version of Index() for short strings on amd64 2015-11-03 16:04:28 +00:00
strings_test.go strings: add asm version of Index() for short strings on amd64 2015-11-03 16:04:28 +00:00
strings.go strings: add asm version of Index() for short strings on amd64 2015-11-03 16:04:28 +00:00
strings.s