• Nick Craig-Wood's avatar
    An ARM version of sha1block.go with a big improvement in throughput · 44c252bd
    Nick Craig-Wood authored
    (up to 2.8x).
    
    This is a partially unrolled version which performs better for small
    hashes and only sacrifices a small amount of ultimate speed to a fully
    unrolled version which uses 5k of code.
    
    Code size
    
      Before 1636 bytes
      After 1880 bytes
      15% larger
    
    Benchmarks on Samsung Exynos 5 ARMv7 Chromebook
    
    benchmark              old ns/op    new ns/op    delta
    BenchmarkHash8Bytes         1907         1136  -40.43%
    BenchmarkHash1K            20280         7547  -62.79%
    BenchmarkHash8K           148469        52576  -64.59%
    
    benchmark               old MB/s     new MB/s  speedup
    BenchmarkHash8Bytes         4.19         7.04    1.68x
    BenchmarkHash1K            50.49       135.68    2.69x
    BenchmarkHash8K            55.18       155.81    2.82x
    
    LGTM=dave, agl
    R=dave, bradfitz, agl, adg, nick
    CC=golang-codereviews
    https://golang.org/cl/56990044
    44c252bd
sha1block_decl.go 249 Bytes