• Rui Ueyama's avatar
    image/png: use branch-free abs function · 0100afbd
    Rui Ueyama authored
    benchmark                        old ns/op     new ns/op     delta
    BenchmarkPaeth                   5.06          6.02          +18.97%
    BenchmarkDecodeGray              1010551       956911        -5.31%
    BenchmarkDecodeNRGBAGradient     3877813       3754160       -3.19%
    BenchmarkDecodeNRGBAOpaque       3194058       3079094       -3.60%
    BenchmarkDecodePaletted          699243        700211        +0.14%
    BenchmarkDecodeRGB               2835733       2692120       -5.06%
    BenchmarkDecodeInterlacing       3651805       3563124       -2.43%
    BenchmarkEncodeGray              4399183       4404113       +0.11%
    BenchmarkEncodeNRGBOpaque        13323627      13306485      -0.13%
    BenchmarkEncodeNRGBA             15840092      15751188      -0.56%
    BenchmarkEncodePaletted          4396622       4404373       +0.18%
    BenchmarkEncodeRGBOpaque         13320475      13279189      -0.31%
    BenchmarkEncodeRGBA              36898392      36781002      -0.32%
    
    LGTM=nigeltao
    R=nigeltao
    CC=golang-codereviews
    https://golang.org/cl/117290043
    0100afbd
paeth.go 1.73 KB