• Nigel Tao's avatar
    image: change Pix from []FooColor to []uint8. · 8bd50895
    Nigel Tao authored
    Some benchmark numbers below. The image/draw fast-paths show dramatic
    improvement, the generic slow-paths show a smaller slow-down.
    
    BEFORE
    png.BenchmarkEncodePaletted      200       8203800 ns/op      37.45 MB/s
    png.BenchmarkEncodeRGBOpaque         100      26940440 ns/op      45.61 MB/s
    png.BenchmarkEncodeRGBA       20      73821000 ns/op      16.65 MB/s
    jpeg.BenchmarkEncodeRGBOpaque         50      35598640 ns/op      34.52 MB/s
    draw.BenchmarkFillOver	     500	   4024226 ns/op
    draw.BenchmarkFillSrc	   10000	    152736 ns/op
    draw.BenchmarkCopyOver	     500	   3452824 ns/op
    draw.BenchmarkCopySrc	   50000	     73218 ns/op
    draw.BenchmarkNRGBAOver	     500	   3941234 ns/op
    draw.BenchmarkNRGBASrc	    1000	   2484400 ns/op
    draw.BenchmarkYCbCr	    1000	   2609005 ns/op
    draw.BenchmarkGlyphOver	    2000	   1169575 ns/op
    draw.BenchmarkRGBA	     200	   9031390 ns/op
    draw.BenchmarkGenericOver	      50	  34636620 ns/op
    draw.BenchmarkGenericMaskOver	     100	  16561150 ns/op
    draw.BenchmarkGenericSrc	     100	  13873760 ns/op
    draw.BenchmarkGenericMaskSrc	     100	  25198860 ns/op
    
    AFTER
    png.BenchmarkEncodePaletted      200       8206600 ns/op      37.43 MB/s
    png.BenchmarkEncodeRGBOpaque         100      26129530 ns/op      47.03 MB/s
    png.BenchmarkEncodeRGBA       20      75776750 ns/op      16.22 MB/s
    jpeg.BenchmarkEncodeRGBOpaque         50      37192940 ns/op      33.04 MB/s
    draw.BenchmarkFillOver	     500	   3008134 ns/op
    draw.BenchmarkFillSrc	   10000	    154214 ns/op
    draw.BenchmarkCopyOver	    1000	   2169988 ns/op
    draw.BenchmarkCopySrc	   50000	     73095 ns/op
    draw.BenchmarkNRGBAOver	    1000	   2491079 ns/op
    draw.BenchmarkNRGBASrc	    2000	   1361244 ns/op
    draw.BenchmarkYCbCr	    1000	   2554269 ns/op
    draw.BenchmarkGlyphOver	    2000	   1042225 ns/op
    draw.BenchmarkRGBA	     100	  10233340 ns/op
    draw.BenchmarkGenericOver	      50	  38421560 ns/op
    draw.BenchmarkGenericMaskOver	     100	  17521190 ns/op
    draw.BenchmarkGenericSrc	     100	  16351200 ns/op
    draw.BenchmarkGenericMaskSrc	     100	  26538190 ns/op
    
    R=r
    CC=golang-dev
    https://golang.org/cl/4675076
    8bd50895
Name
Last commit
Last update
..
archive Loading commit data...
asn1 Loading commit data...
big Loading commit data...
bufio Loading commit data...
bytes Loading commit data...
cmath Loading commit data...
compress Loading commit data...
container Loading commit data...
crypto Loading commit data...
csv Loading commit data...
debug Loading commit data...
ebnf Loading commit data...
encoding Loading commit data...
exec Loading commit data...
exp Loading commit data...
expvar Loading commit data...
flag Loading commit data...
fmt Loading commit data...
go Loading commit data...
gob Loading commit data...
hash Loading commit data...
html Loading commit data...
http Loading commit data...
image Loading commit data...
index/suffixarray Loading commit data...
io Loading commit data...
json Loading commit data...
log Loading commit data...
mail Loading commit data...
math Loading commit data...
mime Loading commit data...
net Loading commit data...
netchan Loading commit data...
os Loading commit data...
patch Loading commit data...
path Loading commit data...
rand Loading commit data...
reflect Loading commit data...
regexp Loading commit data...
rpc Loading commit data...
runtime Loading commit data...
scanner Loading commit data...
smtp Loading commit data...
sort Loading commit data...
strconv Loading commit data...
strings Loading commit data...
sync Loading commit data...
syscall Loading commit data...
syslog Loading commit data...
tabwriter Loading commit data...
template Loading commit data...
testing Loading commit data...
time Loading commit data...
try Loading commit data...
unicode Loading commit data...
unsafe Loading commit data...
utf16 Loading commit data...
utf8 Loading commit data...
websocket Loading commit data...
xml Loading commit data...
Makefile Loading commit data...
deps.bash Loading commit data...