Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(74)

Issue 4675076: code review 4675076: image: change Pix from []FooColor to []uint8. (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years, 10 months ago by nigeltao
Modified:
12 years, 10 months ago
Reviewers:
CC:
r, golang-dev
Visibility:
Public.

Description

image: change Pix from []FooColor to []uint8. 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

Patch Set 1 #

Patch Set 2 : diff -r 9e1ea214ad59 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 9e1ea214ad59 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r c0789de6bd91 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+367 lines, -296 lines) Patch
M src/pkg/exp/gui/x11/conn.go View 1 1 chunk +9 lines, -8 lines 0 comments Download
M src/pkg/image/bmp/reader.go View 1 1 chunk +6 lines, -3 lines 0 comments Download
M src/pkg/image/color.go View 1 9 chunks +12 lines, -12 lines 0 comments Download
M src/pkg/image/draw/draw.go View 1 13 chunks +135 lines, -124 lines 0 comments Download
M src/pkg/image/image.go View 1 2 3 39 chunks +193 lines, -124 lines 0 comments Download
M src/pkg/image/jpeg/reader.go View 1 1 chunk +1 line, -10 lines 0 comments Download
M src/pkg/image/jpeg/writer.go View 1 1 chunk +3 lines, -3 lines 0 comments Download
M src/pkg/image/png/writer.go View 1 4 chunks +8 lines, -12 lines 0 comments Download

Messages

Total messages: 4
nigeltao
Hello r@golang.org (cc: golang-dev@googlegroups.com), I'd like you to review this change to https://go.googlecode.com/hg/
12 years, 10 months ago (2011-07-11 07:55:37 UTC) #1
r
LGTM some of the code is clunkier than before but it's an improvement overall, i'm ...
12 years, 10 months ago (2011-07-11 08:10:29 UTC) #2
nigeltao
image/draw benchmarks below. The generic DrawMask code becomes slower (I'm guessing that Image.At and Image.Set ...
12 years, 10 months ago (2011-07-12 05:12:30 UTC) #3
nigeltao
12 years, 10 months ago (2011-07-12 06:39:44 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=0b3622ab5881 ***

image: change Pix from []FooColor to []uint8.

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
http://codereview.appspot.com/4675076
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b