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

Issue 11419284: Move second internal recursion to a precomputation in layer_tree_host_common.cc (Closed)

Created:
8 years ago by shawnsingh
Modified:
8 years ago
Reviewers:
danakj, jamesr, slavi, skaslev
CC:
chromium-reviews, cc-bugs_chromium.org
Visibility:
Public.

Description

Move second internal recursion to a precomputation in layer_tree_host_common.cc Asymptotically, the recursive algorithm in calculateDrawTransforms is O(n^2) because of a secondary recursion that occurs for every layer in subtreeShouldRenderToSeparateSurface. This patch moves the internal secondary recursion into a pre-walk, caching the meaningful result of that recursion, so that the algorithm is O(2 * n). Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=172682

Patch Set 1 #

Patch Set 2 : #

Total comments: 6

Patch Set 3 : cleaned up and rebased #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+45 lines, -51 lines) Patch
M cc/delegated_renderer_layer_impl.h View 1 2 1 chunk +1 line, -1 line 0 comments Download
M cc/delegated_renderer_layer_impl.cc View 1 2 1 chunk +2 lines, -7 lines 0 comments Download
M cc/draw_properties.h View 1 2 2 chunks +4 lines, -0 lines 0 comments Download
M cc/layer.h View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M cc/layer.cc View 1 2 1 chunk +0 lines, -13 lines 0 comments Download
M cc/layer_impl.h View 1 2 2 chunks +1 line, -5 lines 0 comments Download
M cc/layer_impl.cc View 1 2 2 chunks +5 lines, -13 lines 0 comments Download
M cc/layer_tree_host_common.cc View 1 2 4 chunks +31 lines, -7 lines 3 comments Download

Messages

Total messages: 10 (0 generated)
shawnsingh
Summary: performance doesn't improve, seems to stay approximately the same. So James I'm not sure ...
8 years ago (2012-12-03 08:02:17 UTC) #1
danakj
https://codereview.chromium.org/11419284/diff/2001/cc/layer_impl.h File cc/layer_impl.h (right): https://codereview.chromium.org/11419284/diff/2001/cc/layer_impl.h#newcode103 cc/layer_impl.h:103: virtual int numDescendantsThatDrawContent() { return m_numDescendantsThatDrawContent; } i like ...
8 years ago (2012-12-03 18:33:41 UTC) #2
shawnsingh
Ohhh, I'm really sorry I made you review this. I should have said "NOT FOR ...
8 years ago (2012-12-03 19:40:34 UTC) #3
slavi
It's interesting that we don't see any improvement from that patch. It will never do ...
8 years ago (2012-12-03 21:33:32 UTC) #4
slavi
https://codereview.chromium.org/11419284/diff/2001/cc/layer.h File cc/layer.h (right): https://codereview.chromium.org/11419284/diff/2001/cc/layer.h#newcode419 cc/layer.h:419: bool m_numDescendantsThatDrawContent; That should be an int. https://codereview.chromium.org/11419284/diff/2001/cc/layer_impl.h File ...
8 years ago (2012-12-03 21:33:42 UTC) #5
shawnsingh
So after offline discussion with slavi and jamesr: Slavi had the very good point that ...
8 years ago (2012-12-03 23:05:12 UTC) #6
jamesr
On 2012/12/03 21:33:32, slavi wrote: > Besides the comments I made on the code, I ...
8 years ago (2012-12-04 06:09:01 UTC) #7
shawnsingh
This patch is rebooted now. PTAL, thanks!
8 years ago (2012-12-12 11:54:52 UTC) #8
jamesr
lgtm https://codereview.chromium.org/11419284/diff/12001/cc/layer_tree_host_common.cc File cc/layer_tree_host_common.cc (right): https://codereview.chromium.org/11419284/diff/12001/cc/layer_tree_host_common.cc#newcode286 cc/layer_tree_host_common.cc:286: (numDescendantsThatDrawContent > 0 && (layer->drawsContent() || numDescendantsThatDrawContent > ...
8 years ago (2012-12-12 16:54:25 UTC) #9
slavi
8 years ago (2012-12-12 21:46:01 UTC) #10
Awesome lgtm.

Powered by Google App Engine
This is Rietveld 408576698