• Nigel Tao's avatar
    image/png: optimize paeth some more. · dbcdce58
    Nigel Tao authored
    filterPaeth takes []byte arguments instead of byte arguments,
    which avoids some redudant computation of the previous pixel
    in the inner loop.
    
    Also eliminate a bounds check in decoding the up filter.
    
    benchmark                       old ns/op    new ns/op    delta
    BenchmarkDecodeGray               3139636      2812531  -10.42%
    BenchmarkDecodeNRGBAGradient     12341520     10971680  -11.10%
    BenchmarkDecodeNRGBAOpaque       10740780      9612455  -10.51%
    BenchmarkDecodePaletted           1819535      1818913   -0.03%
    BenchmarkDecodeRGB                8974695      8178070   -8.88%
    
    R=rsc
    CC=golang-dev
    https://golang.org/cl/6243061
    dbcdce58
Name
Last commit
Last update
..
color Loading commit data...
draw Loading commit data...
gif Loading commit data...
jpeg Loading commit data...
png Loading commit data...
testdata Loading commit data...
decode_example_test.go Loading commit data...
decode_test.go Loading commit data...
format.go Loading commit data...
geom.go Loading commit data...
image.go Loading commit data...
image_test.go Loading commit data...
names.go Loading commit data...
ycbcr.go Loading commit data...
ycbcr_test.go Loading commit data...