• Nigel Tao's avatar
    image/draw: optimize out some bounds checks. · e424d596
    Nigel Tao authored
    We could undoubtedly squeeze even more out of these loops, and in the
    long term, a better compiler would be smarter with bounds checks, but in
    the short term, this small change is an easy win.
    
    benchmark                      old ns/op     new ns/op     delta
    BenchmarkFillOver-8            1619470       1323192       -18.29%
    BenchmarkCopyOver-8            1129369       1062787       -5.90%
    BenchmarkGlyphOver-8           420070        378608        -9.87%
    
    On github.com/golang/freetype/truetype's BenchmarkDrawString:
    benchmark                 old ns/op     new ns/op     delta
    BenchmarkDrawString-8     9561435       8807019       -7.89%
    
    Change-Id: Ib1c6271ac18bced85e0fb5ebf250dd57d7747e75
    Reviewed-on: https://go-review.googlesource.com/14093Reviewed-by: 's avatarRob Pike <r@golang.org>
    e424d596
Name
Last commit
Last update
..
color Loading commit data...
draw Loading commit data...
gif Loading commit data...
internal/imageutil 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...
geom_test.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...