• Dave Cheney's avatar
    runtime: add arm64 runtime.cmpstring and bytes.Compare · ee349b5d
    Dave Cheney authored
    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/8541Reviewed-by: 's avatarAram Hăvărneanu <aram@mgk.ro>
    Reviewed-by: 's avatarDavid Crawshaw <crawshaw@golang.org>
    ee349b5d
noasm.go 950 Bytes