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

Issue 644313002: cc: Use reverse spiral iterator in tiling eviction. (Closed)

Created:
6 years, 2 months ago by vmpstr
Modified:
6 years ago
CC:
chromium-reviews, cc-bugs_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Project:
chromium
Visibility:
Public.

Description

cc: Use reverse spiral iterator in tiling eviction. This patch optimizes the way we do eviction at the tiling level. Instead of using sort, it uses a reverse spiral iterator to iterate tiles in reverse order of what it would have been rasterized in. The fundamental difference in results is that the tiling no longer uses the tree priority to determine the order of tiles. In practice this means that each tiling (and thus each layer) will return tiles that it thinks should be evicted without regard for twin priority. It's up to the tile manager priority queue to reconcile the two. The tile manager priority queue already uses tree priority to determine the tile priority and returns an appropriate (less needed) tile. However, there are situations where this still yields worse results than before. For instance if we're in smoothness mode, and a pending tree has unshared tiles, those used to be returned first (since active tree priority is inf). However, now the pending tree will return the tile that is furthest away from the pending tree viewport, which means it might return a tile that is shared before an unshared one. I personally think this is acceptable, since we're gaining quite a bit of a performance win here (8x-10x on cc_perftests with "*Eviction*" filter). R=reveman, danakj

Patch Set 1 #

Total comments: 9

Patch Set 2 : update #

Total comments: 4

Patch Set 3 : #

Total comments: 5
Unified diffs Side-by-side diffs Delta from patch set Stats (+273 lines, -303 lines) Patch
M cc/layers/picture_layer_impl.h View 1 2 2 chunks +1 line, -3 lines 0 comments Download
M cc/layers/picture_layer_impl.cc View 1 2 4 chunks +1 line, -13 lines 0 comments Download
M cc/layers/picture_layer_impl_perftest.cc View 1 2 2 chunks +2 lines, -14 lines 0 comments Download
M cc/layers/picture_layer_impl_unittest.cc View 1 2 6 chunks +52 lines, -61 lines 0 comments Download
M cc/resources/eviction_tile_priority_queue.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M cc/resources/eviction_tile_priority_queue.cc View 1 2 chunks +4 lines, -8 lines 0 comments Download
M cc/resources/picture_layer_tiling.h View 1 2 5 chunks +14 lines, -22 lines 1 comment Download
M cc/resources/picture_layer_tiling.cc View 1 2 8 chunks +170 lines, -141 lines 4 comments Download
M cc/resources/picture_layer_tiling_perftest.cc View 1 2 3 chunks +0 lines, -13 lines 0 comments Download
M cc/resources/picture_layer_tiling_unittest.cc View 1 2 6 chunks +7 lines, -22 lines 0 comments Download
M cc/resources/tile_manager_unittest.cc View 1 2 6 chunks +21 lines, -4 lines 0 comments Download

Messages

Total messages: 14 (2 generated)
vmpstr
PTAL. This depends on the reverse spiral iterator patch.
6 years, 2 months ago (2014-10-13 03:41:57 UTC) #1
ajuma
I'm trying to wrap my head around this stuff and have a few questions. https://codereview.chromium.org/644313002/diff/1/cc/layers/picture_layer_impl_unittest.cc ...
6 years, 2 months ago (2014-10-23 23:12:54 UTC) #3
USE eero AT chromium.org
> This patch optimizes the way we do eviction at the tiling level. Instead of ...
6 years, 1 month ago (2014-10-28 19:27:09 UTC) #4
vmpstr
PTAL https://codereview.chromium.org/644313002/diff/1/cc/layers/picture_layer_impl_unittest.cc File cc/layers/picture_layer_impl_unittest.cc (right): https://codereview.chromium.org/644313002/diff/1/cc/layers/picture_layer_impl_unittest.cc#newcode2868 cc/layers/picture_layer_impl_unittest.cc:2868: EXPECT_EQ(55, distance_decreasing); On 2014/10/23 23:12:54, ajuma wrote: > ...
6 years, 1 month ago (2014-10-29 18:19:41 UTC) #5
ajuma
Thanks, lgtm. https://codereview.chromium.org/644313002/diff/1/cc/layers/picture_layer_impl_unittest.cc File cc/layers/picture_layer_impl_unittest.cc (right): https://codereview.chromium.org/644313002/diff/1/cc/layers/picture_layer_impl_unittest.cc#newcode2868 cc/layers/picture_layer_impl_unittest.cc:2868: EXPECT_EQ(55, distance_decreasing); On 2014/10/29 18:19:41, vmpstr wrote: ...
6 years, 1 month ago (2014-10-29 19:42:39 UTC) #6
reveman
https://codereview.chromium.org/644313002/diff/70001/cc/resources/picture_layer_tiling.h File cc/resources/picture_layer_tiling.h (right): https://codereview.chromium.org/644313002/diff/70001/cc/resources/picture_layer_tiling.h#newcode134 cc/resources/picture_layer_tiling.h:134: void AdvanceNow(bool first_run); If I understand the code correctly, ...
6 years, 1 month ago (2014-11-11 00:13:27 UTC) #7
vmpstr
https://codereview.chromium.org/644313002/diff/70001/cc/resources/picture_layer_tiling.h File cc/resources/picture_layer_tiling.h (right): https://codereview.chromium.org/644313002/diff/70001/cc/resources/picture_layer_tiling.h#newcode134 cc/resources/picture_layer_tiling.h:134: void AdvanceNow(bool first_run); On 2014/11/11 00:13:27, reveman wrote: > ...
6 years, 1 month ago (2014-11-11 22:02:53 UTC) #8
vmpstr
PTAL https://codereview.chromium.org/644313002/diff/70001/cc/resources/picture_layer_tiling.h File cc/resources/picture_layer_tiling.h (right): https://codereview.chromium.org/644313002/diff/70001/cc/resources/picture_layer_tiling.h#newcode141 cc/resources/picture_layer_tiling.h:141: std::vector<Tile*> unoccluded_now_tiles_; On 2014/11/11 00:13:27, reveman wrote: > ...
6 years, 1 month ago (2014-11-11 22:54:51 UTC) #9
vmpstr
reveman: ping (I have a comment in the #8 that answers your question).
6 years, 1 month ago (2014-11-18 18:02:20 UTC) #10
reveman
My general concern here is that TilingEvictionTileIterator is no longer behaving in a way I ...
6 years, 1 month ago (2014-11-18 20:56:22 UTC) #11
USE eero AT chromium.org
https://codereview.chromium.org/644313002/diff/90001/cc/resources/picture_layer_tiling.cc File cc/resources/picture_layer_tiling.cc (right): https://codereview.chromium.org/644313002/diff/90001/cc/resources/picture_layer_tiling.cc#newcode1172 cc/resources/picture_layer_tiling.cc:1172: while (spiral_iterator_) { This is wrong. If there are ...
6 years, 1 month ago (2014-11-20 15:03:57 UTC) #13
vmpstr
6 years, 1 month ago (2014-11-20 18:45:46 UTC) #14
On 2014/11/20 15:03:57, e_hakkinen wrote:
>
https://codereview.chromium.org/644313002/diff/90001/cc/resources/picture_lay...
> File cc/resources/picture_layer_tiling.cc (right):
> 
>
https://codereview.chromium.org/644313002/diff/90001/cc/resources/picture_lay...
> cc/resources/picture_layer_tiling.cc:1172: while (spiral_iterator_) {
> This is wrong.
> If there are skewport tiles but no soon border rect tiles, the constructor
does
> not initialize the spiral iterator. Then in here, the while block won't be
> executed and the spiral iterator won't be replaced with skewport iterator thus
> skewport tiles won't be iterated at all.

Good catch. I'm going to hold off on this patch for a bit until I can clean up a
bit more of the code, but will fix in the next iteration.

Powered by Google App Engine
This is Rietveld 408576698