Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(293)

Issue 17448010: Speed up png decoding by eliminating branches from the core loop that fills ImageFrame with pixels (Closed)

Created:
7 years, 6 months ago by kbalazs_
Modified:
7 years, 5 months ago
Reviewers:
Nico, Noel Gordon
CC:
blink-reviews, eae+blinkwatch, jeez, Stephen White
Base URL:
https://chromium.googlesource.com/chromium/blink.git@master
Visibility:
Public.

Description

Speed up png decoding by eliminating branches from the core loop that fills ImageFrame with pixels The original idea came from the work of Allan Jensen landed in WebKit as r150252. He eliminated the branches in PNGImageDecoder::rowAvailable to make it benefit from auto vectorization. I tweaked it further to make this change a performance win without auto vectorization as well (which we do not use by default, only with -O3 or -ftree-vectorize). I measured the performance gain with callgrind by comparing the inclusive cost of the affected function. I used simple local pages with a few image for benchmarking. Results: * opaque PNG: 7.8% faster * PNG with alpha: 24% faster R=thakis@chromium.org Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=153004

Patch Set 1 #

Total comments: 2

Patch Set 2 : Speed up png decoding by eliminating branches from the core loop that fills ImageFrame with pixels #

Patch Set 3 : Speed up png decoding by eliminating branches from the core loop that fills ImageFrame with pixels #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+47 lines, -12 lines) Patch
M Source/core/platform/image-decoders/ImageDecoder.h View 1 1 chunk +27 lines, -5 lines 2 comments Download
M Source/core/platform/image-decoders/png/PNGImageDecoder.cpp View 1 1 chunk +20 lines, -7 lines 1 comment Download

Messages

Total messages: 23 (0 generated)
kbalazs_
Continued from https://codereview.chromium.org/15466004/
7 years, 6 months ago (2013-06-19 15:29:21 UTC) #1
Nico
lgtm since this is preserving the existing logic. I'd remove the mention of -O2 from ...
7 years, 6 months ago (2013-06-24 17:54:15 UTC) #2
kbalazs_
On 2013/06/24 17:54:15, Nico wrote: > lgtm since this is preserving the existing logic. > ...
7 years, 6 months ago (2013-06-24 18:31:58 UTC) #3
Nico
On Mon, Jun 24, 2013 at 11:31 AM, <b.kelemen@sisa.samsung.com> wrote: > On 2013/06/24 17:54:15, Nico ...
7 years, 6 months ago (2013-06-24 18:35:13 UTC) #4
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@sisa.samsung.com/17448010/1
7 years, 6 months ago (2013-06-24 18:48:41 UTC) #5
kbalazs_
> > Sounds good. You can also land this as is and switch to > ...
7 years, 6 months ago (2013-06-24 18:49:24 UTC) #6
commit-bot: I haz the power
Retried try job too often on mac_layout_rel for step(s) webkit_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_layout_rel&number=10619
7 years, 6 months ago (2013-06-24 21:53:32 UTC) #7
kbalazs_
https://codereview.chromium.org/17448010/diff/1/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp File Source/core/platform/image-decoders/png/PNGImageDecoder.cpp (right): https://codereview.chromium.org/17448010/diff/1/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp#newcode515 Source/core/platform/image-decoders/png/PNGImageDecoder.cpp:515: buffer.setHasAlpha(hasNonTrivialAlpha); Oops, this war wrong, we cannot make !hasAlpha() ...
7 years, 6 months ago (2013-06-25 13:20:18 UTC) #8
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/b.kelemen@sisa.samsung.com/17448010/27002
7 years, 6 months ago (2013-06-25 13:21:53 UTC) #9
commit-bot: I haz the power
Change committed as 153004
7 years, 6 months ago (2013-06-25 14:24:16 UTC) #10
Noel Gordon
Hey, any reason Peter or myself we not consulted here?
7 years, 6 months ago (2013-06-26 04:58:16 UTC) #11
Noel Gordon
https://chromiumcodereview.appspot.com/17448010/diff/27002/Source/core/platform/image-decoders/ImageDecoder.h File Source/core/platform/image-decoders/ImageDecoder.h (right): https://chromiumcodereview.appspot.com/17448010/diff/27002/Source/core/platform/image-decoders/ImageDecoder.h#newcode195 Source/core/platform/image-decoders/ImageDecoder.h:195: if (!a) { Why did you change the shape ...
7 years, 6 months ago (2013-06-26 05:15:26 UTC) #12
Noel Gordon
And a as practical matter, the cost of writing row data is about 10-15% of ...
7 years, 6 months ago (2013-06-26 06:06:34 UTC) #13
kbalazs_
On 2013/06/26 04:58:16, Noel Gordon (Google) wrote: > Hey, any reason Peter or myself we ...
7 years, 6 months ago (2013-06-26 14:22:26 UTC) #14
kbalazs_
On 2013/06/26 05:15:26, Noel Gordon (Google) wrote: > https://chromiumcodereview.appspot.com/17448010/diff/27002/Source/core/platform/image-decoders/ImageDecoder.h > File Source/core/platform/image-decoders/ImageDecoder.h (right): > > ...
7 years, 6 months ago (2013-06-26 14:26:24 UTC) #15
kbalazs_
On 2013/06/26 06:06:34, Noel Gordon (Google) wrote: > And a as practical matter, the cost ...
7 years, 6 months ago (2013-06-26 14:31:03 UTC) #16
kbalazs_
On 2013/06/26 14:31:03, kbalazs wrote: > On 2013/06/26 06:06:34, Noel Gordon (Google) wrote: > > ...
7 years, 6 months ago (2013-06-26 15:00:09 UTC) #17
Noel Gordon
On 2013/06/26 14:22:26, kbalazs wrote: > On 2013/06/26 04:58:16, Noel Gordon (Google) wrote: > > ...
7 years, 5 months ago (2013-06-27 14:35:32 UTC) #18
Noel Gordon
On 2013/06/26 14:26:24, kbalazs wrote: > https://chromiumcodereview.appspot.com/17448010/diff/27002/Source/core/platform/image-decoders/png/PNGImageDecoder.cpp#newcode500 > > Source/core/platform/image-decoders/png/PNGImageDecoder.cpp:500: > > buffer.setRGBAPremultiply(address + x, ...
7 years, 5 months ago (2013-06-27 14:37:42 UTC) #19
Noel Gordon
On 2013/06/26 15:00:09, kbalazs wrote: > > I see now. In https://bugs.webkit.org/show_bug.cgi?id=103216 you measured the ...
7 years, 5 months ago (2013-06-27 14:44:42 UTC) #20
Noel Gordon
Patch regressed GIF decode perf https://code.google.com/p/chromium/issues/detail?id=254462
7 years, 5 months ago (2013-06-29 00:11:45 UTC) #21
Noel Gordon
https://codereview.chromium.org/17906002 fix attempt
7 years, 5 months ago (2013-06-29 00:13:48 UTC) #22
Noel Gordon
7 years, 5 months ago (2013-06-29 00:26:50 UTC) #23
Message was sent while issue was closed.
Patch regressed JPEG decode perf on some Androids (eg., Nexus 4 uses the system
JPEG).

Powered by Google App Engine
This is Rietveld 408576698