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

Issue 24106007: Replace style sharing cousin list search with LRU (Closed)

Created:
7 years, 3 months ago by leviw_travelin_and_unemployed
Modified:
7 years, 3 months ago
Reviewers:
esprehn, ojan
CC:
blink-reviews, apavlov+blink_chromium.org, dglazkov+blink, eae+blinkwatch, adamk+blink_chromium.org, darktears
Visibility:
Public.

Description

Replace style sharing cousin list search with LRU The current implementation of style sharing uses a very confusing set of methods to search a node's cousins in an attempt to find other nodes to share style with. This patch replaces this confusing method with a simple LRU that allows us to find nodes to share with even if they're not our cousins. Re-worked to be simpler in the lazy-attach world (thanks esprehn & ojan!). Previous commits of this change had perf regressions, the last of which should be handled by only adding elements to the style sharing LRU during recalcStyle if sharing is indeed possible for the element. Without this, in the degenerate case where there's a large document and no elements can share style (like the fixed-grid-lots-of-data performance test) we'd end up doing more work. Because this change introduces RefPtrs that can hold onto nodes while the style resolver is active, Internal gc functions are updated to clear the style sharing list. Previous codereviews https://codereview.chromium.org/23075004/ and https://chromiumcodereview.appspot.com/23049008 BUG=272363, 286376 Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157646

Patch Set 1 #

Total comments: 7

Patch Set 2 : Updating with esprehn's changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -115 lines) Patch
M Source/core/css/resolver/SharedStyleFinder.h View 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/css/resolver/SharedStyleFinder.cpp View 1 6 chunks +43 lines, -112 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 4 chunks +13 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 1 chunk +54 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 2 chunks +5 lines, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 5 (0 generated)
leviw_travelin_and_unemployed
7 years, 3 months ago (2013-09-11 21:37:29 UTC) #1
esprehn
LGTM, two comments, I think you want to check elementCanShareStyle() at the top of find*() ...
7 years, 3 months ago (2013-09-11 21:53:01 UTC) #2
leviw_travelin_and_unemployed
https://codereview.chromium.org/24106007/diff/1/Source/core/css/resolver/SharedStyleFinder.cpp File Source/core/css/resolver/SharedStyleFinder.cpp (right): https://codereview.chromium.org/24106007/diff/1/Source/core/css/resolver/SharedStyleFinder.cpp#newcode296 Source/core/css/resolver/SharedStyleFinder.cpp:296: m_styleResolver->addToStyleSharingList(context.element()); On 2013/09/11 21:53:01, esprehn wrote: > If the ...
7 years, 3 months ago (2013-09-11 21:58:15 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/24106007/9001
7 years, 3 months ago (2013-09-11 22:07:06 UTC) #4
commit-bot: I haz the power
7 years, 3 months ago (2013-09-12 00:44:14 UTC) #5
Message was sent while issue was closed.
Change committed as 157646

Powered by Google App Engine
This is Rietveld 408576698