1
0
mirror of https://github.com/golang/go synced 2024-11-21 19:04:44 -07:00
The Go programming language
Go to file
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
doc release.2010-02-04 step one 2010-02-04 17:37:46 -08:00
include libc: add goos, goarch, goroot. fixes build 2010-01-19 09:08:05 -08:00
lib codereview: make sure each mail has a reviewer 2010-01-28 12:48:21 -08:00
misc dashboard: present benchmarks 2010-02-05 02:58:40 -08:00
pkg more description 2009-10-15 23:08:46 -07:00
src draw.Draw fast paths for a nil mask (and RGBA dst). 2010-02-06 15:57:19 +11:00
test Match gccgo error message. 2010-02-05 20:56:20 -08:00
.hgignore add apple's .DS_Store to ignored list 2010-02-03 20:12:39 -08:00
.hgtags release.2010-02-04 2010-02-04 17:39:51 -08:00
AUTHORS A+C: Joe Poirier (individual CLA) 2010-02-04 13:08:47 -08:00
CONTRIBUTORS A+C: Joe Poirier (individual CLA) 2010-02-04 13:08:47 -08:00
favicon.ico add a favicon plus a couple of hi-res versions of gordon 2009-10-26 10:13:07 -07:00
LICENSE Add an explicit patent grant to the Go license. 2010-01-25 15:39:32 -08:00
README add a README file, so that if someone finds a 2009-11-08 09:57:37 -08:00

This is the source code repository for the Go programming language.  

For documentation about how to install and use Go,
visit http://golang.org/ or load doc/install.html in your web browser.

After installing Go, you can view a nicely formatted
doc/install.html by running godoc --http=:6060
and then visiting http://localhost:6060/doc/install.html.

Unless otherwise noted, the Go source files are distributed
under the BSD-style license found in the LICENSE file.