]> Cypherpunks repositories - gostls13.git/commit
runtime: add runtime.cmpstring and bytes.Compare
authorDave Cheney <dave@cheney.net>
Tue, 24 Mar 2015 09:37:10 +0000 (09:37 +0000)
committerDave Cheney <dave@cheney.net>
Wed, 25 Mar 2015 22:46:39 +0000 (22:46 +0000)
commite2543ef62c98b2ce07a54698e6a8293f380a1128
tree78235d27f06b7c96fa293b6d1a3a42333b3fcf9e
parenta3a193c01855fc15429d5376f4dad11796b2b7bd
runtime: add runtime.cmpstring and bytes.Compare

Update #10007

Implement runtime.cmpstring and bytes.Compare in asm for arm.

benchmark                                old ns/op     new ns/op     delta
BenchmarkCompareBytesEqual               254           91.4          -64.02%
BenchmarkCompareBytesToNil               41.5          37.6          -9.40%
BenchmarkCompareBytesEmpty               40.7          37.6          -7.62%
BenchmarkCompareBytesIdentical           255           96.3          -62.24%
BenchmarkCompareBytesSameLength          125           60.9          -51.28%
BenchmarkCompareBytesDifferentLength     133           60.9          -54.21%
BenchmarkCompareBytesBigUnaligned        17985879      5669706       -68.48%
BenchmarkCompareBytesBig                 17097634      4926798       -71.18%
BenchmarkCompareBytesBigIdentical        16861941      4389206       -73.97%

benchmark                             old MB/s     new MB/s     speedup
BenchmarkCompareBytesBigUnaligned     58.30        184.95       3.17x
BenchmarkCompareBytesBig              61.33        212.83       3.47x
BenchmarkCompareBytesBigIdentical     62.19        238.90       3.84x

This is a collaboration between Josh Bleecher Snyder and myself.

Change-Id: Ib3944b8c410d0e12135c2ba9459bfe131df48edd
Reviewed-on: https://go-review.googlesource.com/8010
Reviewed-by: Keith Randall <khr@golang.org>
src/bytes/compare_test.go
src/runtime/asm_arm.s
src/runtime/noasm.go