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

Issue 4468044: code review 4468044: exp/draw: fast paths for drawing a YCbCr or an NRGBA on... (Closed)

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

Description

exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA. On my laptop, I had an 800x600 jpeg and an 800x600 png (with transparency). I timed how long it took to draw each image onto an equivalently sized, zeroed RGBA image. Previously, the jpeg took 75ms and the png took 70ms, going through the medium-fast path, i.e. func drawRGBA in draw.go. After this CL, the jpeg took 14ms, and the png took 21ms with the Over operator and 12ms with the Src operator. It's only a rough estimate basd on one image file, but it should give an idea of the order of magnitude of improvement.

Patch Set 1 #

Patch Set 2 : diff -r 502384dd99e8 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r 502384dd99e8 https://go.googlecode.com/hg/ #

Total comments: 3

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

Unified diffs Side-by-side diffs Delta from patch set Stats (+171 lines, -8 lines) Patch
M src/pkg/exp/draw/draw.go View 1 4 chunks +121 lines, -8 lines 0 comments Download
M src/pkg/exp/draw/draw_test.go View 1 3 chunks +50 lines, -0 lines 0 comments Download

Messages

Total messages: 4
nigeltao
Hello rsc (cc: adg, golang-dev@googlegroups.com, r), I'd like you to review this change to https://go.googlecode.com/hg/
14 years ago (2011-05-04 13:31:57 UTC) #1
r
LGTM http://codereview.appspot.com/4468044/diff/3001/src/pkg/exp/draw/draw.go File src/pkg/exp/draw/draw.go (right): http://codereview.appspot.com/4468044/diff/3001/src/pkg/exp/draw/draw.go#newcode71 src/pkg/exp/draw/draw.go:71: switch src0 := src.(type) { you can reuse ...
14 years ago (2011-05-04 16:05:00 UTC) #2
nigeltao
http://codereview.appspot.com/4468044/diff/3001/src/pkg/exp/draw/draw.go File src/pkg/exp/draw/draw.go (right): http://codereview.appspot.com/4468044/diff/3001/src/pkg/exp/draw/draw.go#newcode71 src/pkg/exp/draw/draw.go:71: switch src0 := src.(type) { On 2011/05/04 16:05:01, r ...
14 years ago (2011-05-04 16:22:13 UTC) #3
nigeltao
14 years ago (2011-05-04 17:17:58 UTC) #4
*** Submitted as http://code.google.com/p/go/source/detail?r=949313d4c508 ***

exp/draw: fast paths for drawing a YCbCr or an NRGBA onto an RGBA.

On my laptop, I had an 800x600 jpeg and an 800x600 png (with
transparency). I timed how long it took to draw each image onto an
equivalently sized, zeroed RGBA image.

Previously, the jpeg took 75ms and the png took 70ms, going through
the medium-fast path, i.e. func drawRGBA in draw.go.

After this CL, the jpeg took 14ms, and the png took 21ms with the
Over operator and 12ms with the Src operator.

It's only a rough estimate basd on one image file, but it should
give an idea of the order of magnitude of improvement.

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

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