1
0
mirror of https://github.com/golang/go synced 2024-11-25 04:07:55 -07:00
go/src
Nigel Tao 48cdb63baa draw.Draw fast paths for a nil mask (and RGBA dst).
Averaged times (in microseconds) for drawing an 800x600 rectangle
are listed below. The summary is: around a 100x improvement.

draw.Draw call times were typically linear in the number of pixels
touched (i.e. drawing an 800x600 rectangle took 100x as much time as
drawing an 80x60 rectangle).

Before this change, there was only the general-but-slow code path.
When drawing any src with a 50%-opaque mask: 237300 us
When drawing any src with a nil mask: 50100 us

After this change, the 50%-opaque mask case is unchanged.
For an *image.RGBA dst and nil mask and...
...a uniform color (i.e. an image.ColorImage) src: 282 us
...another *image.RGBA src: 615 us.

For the curious, an intermediate implementation detected the special
cases but used simple nested for loops instead of the built-in copy
function. The respective times (compared to 282 and 615 for the
final implementation, or 50100 for the original) were 3110 and 3573.

Times were measured with 8g/8l on my laptop. I haven't tried gccgo
or other architectures.

R=r, rsc
CC=golang-dev
https://golang.org/cl/201048
2010-02-06 15:57:19 +11:00
..
cmd bug in const float divide 2010-02-05 15:18:32 -08:00
lib9 build: move GOOS, GOARCH, GOROOT lookup into central library. 2010-01-18 21:46:46 -08:00
libbio Ports of lib9, libbio and libmach to Windows. 2009-11-30 11:53:11 -08:00
libcgo go: makes it build for the case $GOROOT has whitespaces 2009-11-23 17:32:51 -08:00
libmach libmach: Add disassembly for newly implemented opcodes 2010-01-06 19:26:04 -08:00
pkg draw.Draw fast paths for a nil mask (and RGBA dst). 2010-02-06 15:57:19 +11:00
all-arm.bash arm: toss make-arm.bash 2010-02-03 20:46:37 -08:00
all-nacl.bash nacl: fix build, finally fixed 8l convergence bug 2010-02-01 15:20:19 -08:00
all.bash Remove top-level (src/) Makefile. 2010-01-25 00:09:46 -08:00
clean.bash clean.bash: stop if $GOROOT is not set 2009-12-13 12:27:19 -08:00
Make.386 makefile fixes; convert runtime to use new makefiles 2009-08-13 14:41:10 -07:00
Make.amd64 makefile fixes; convert runtime to use new makefiles 2009-08-13 14:41:10 -07:00
Make.arm makefile fixes; convert runtime to use new makefiles 2009-08-13 14:41:10 -07:00
make.bash arm: toss make-arm.bash 2010-02-03 20:46:37 -08:00
Make.cmd Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src 2009-12-11 15:14:09 -08:00
Make.conf Fix missing explicit GOBIN in src/pkg/Makefile. Clean up creation of 2010-01-06 07:47:56 -08:00
Make.pkg Add 'bench' target to makefiles. 2010-01-12 15:43:20 -08:00
quietgcc.bash Build changes to support work on the BSDs. 2009-11-14 15:29:09 -08:00
run.bash Remove GOBIN in PATH dependency; don't assume cwd is $GOROOT/src 2009-12-11 15:14:09 -08:00
sudo.bash go: makes it build for the case $GOROOT has whitespaces 2009-11-23 17:32:51 -08:00