Add arm64 assembly implementation of runtime.cmpstring and bytes.Compare.
benchmark old ns/op new ns/op delta
BenchmarkCompareBytesEqual 98.0 27.5 -71.94%
BenchmarkCompareBytesToNil 9.38 10.0 +6.61%
BenchmarkCompareBytesEmpty 13.3 10.0 -24.81%
BenchmarkCompareBytesIdentical 98.0 27.5 -71.94%
BenchmarkCompareBytesSameLength 43.3 16.3 -62.36%
BenchmarkCompareBytesDifferentLength 43.4 16.3 -62.44%
BenchmarkCompareBytesBigUnaligned 6979680 1360979 -80.50%
BenchmarkCompareBytesBig 6915995 1381979 -80.02%
BenchmarkCompareBytesBigIdentical 6781440 1327304 -80.43%
benchmark old MB/s new MB/s speedup
BenchmarkCompareBytesBigUnaligned 150.23 770.46 5.13x
BenchmarkCompareBytesBig 151.62 758.76 5.00x
BenchmarkCompareBytesBigIdentical 154.63 790.01 5.11x
* note, the machine we are benchmarking on has some issues. What is clear is
compared to a few days ago the old MB/s value has increased from ~115 to 150.
I'm less certain about the new MB/s number, which used to be close to 1Gb/s.
Change-Id: I4f31b2c7a06296e13912aacc958525632cb0450d
Reviewed-on: https://go-review.googlesource.com/8541
Reviewed-by: Aram Hăvărneanu <aram@mgk.ro>
Reviewed-by: David Crawshaw <crawshaw@golang.org>
This makes it easier to experiment with alternative implementations.
While we're here, update the comments.
No functional changes. Passes toolstash -cmp.
Change-Id: I428535754908f0fdd7cc36c214ddb6e1e60f376e
Reviewed-on: https://go-review.googlesource.com/8310
Reviewed-by: Keith Randall <khr@golang.org>
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
runtime·main·f is normalized by the linker to runtime.main.f, as is
the compiler-generated symbol runtime.main·f. Change the former to
runtime·mainPC instead.
Fixes issue #9934
Change-Id: I656a6fa6422d45385fa2cc55bd036c6affa1abfe
Reviewed-on: https://go-review.googlesource.com/8234
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>