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

Issue 1223044: code review 1223044: Fast-ish path for drawing onto an image.RGBA destination. (Closed)

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

Description

Fast-ish path for drawing onto an image.RGBA destination. Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to 5.6ms (and 0 mallocs). It's still relatively slow since it assumes nothing about the src or mask images, but it does remove the malloc. There are existing faster, more specialized paths for copies, fills and image glyph masks. Also added a "compare to a slow but obviously correct implementation" check to draw_test.go.

Patch Set 1 #

Patch Set 2 : code review 1223044: Fast-ish path for drawing onto an image.RGBA destination. #

Patch Set 3 : code review 1223044: Fast-ish path for drawing onto an image.RGBA destination. #

Patch Set 4 : code review 1223044: Fast-ish path for drawing onto an image.RGBA destination. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+121 lines, -13 lines) Patch
M src/pkg/exp/draw/draw.go View 1 3 chunks +64 lines, -10 lines 0 comments Download
M src/pkg/exp/draw/draw_test.go View 1 2 3 1 chunk +57 lines, -3 lines 0 comments Download

Messages

Total messages: 4
nigeltao
Hello rsc (cc: golang-dev@googlegroups.com), I'd like you to review this change.
15 years, 3 months ago (2010-05-20 13:25:19 UTC) #1
r
LGTM
15 years, 3 months ago (2010-05-20 16:38:06 UTC) #2
rsc
LGTM But are you sure about the * 0x101? I am surprised that you can ...
15 years, 3 months ago (2010-05-20 16:44:42 UTC) #3
nigeltao
15 years, 3 months ago (2010-05-20 20:58:08 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=62d483b851f5 ***

Fast-ish path for drawing onto an image.RGBA destination.

Time to draw.Draw a 200x200 image fell from 18.4ms (and 1 malloc) to
5.6ms (and 0 mallocs). It's still relatively slow since it assumes
nothing about the src or mask images, but it does remove the malloc.
There are existing faster, more specialized paths for copies, fills
and image glyph masks.

Also added a "compare to a slow but obviously correct implementation"
check to draw_test.go.

R=rsc, r
CC=golang-dev
http://codereview.appspot.com/1223044
Sign in to reply to this message.

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