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

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

Created:
7 years, 4 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. The previous implementation of this was reverted due to a performance regression due to decreased sharing occurring in certain situations during parse time when we'd clear the LRU after every node was appended. This updated patch uses RefPtrs to allow these nodes to be held onto, and avoids clearing the LRU during attach, and only when styles change. 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 codereview: https://codereview.chromium.org/23075004/ Committed: https://src.chromium.org/viewvc/blink?view=rev&revision=157311

Patch Set 1 #

Patch Set 2 : Updating to ToT #

Total comments: 5

Patch Set 3 : Making Elliott's suggested changes #

Patch Set 4 : ToT + Elliott's changes #

Total comments: 3

Patch Set 5 : Using Elliott's recommendations #

Patch Set 6 : Patch for landing #

Patch Set 7 : Can't repro the GC issues locally... Trying another clear. #

Patch Set 8 : Updating to ToT #

Unified diffs Side-by-side diffs Delta from patch set Stats (+89 lines, -81 lines) Patch
M Source/core/css/resolver/SharedStyleFinder.h View 1 1 chunk +1 line, -2 lines 0 comments Download
M Source/core/css/resolver/SharedStyleFinder.cpp View 1 2 3 4 5 6 7 5 chunks +42 lines, -78 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.h View 1 2 3 4 5 6 7 4 chunks +11 lines, -0 lines 0 comments Download
M Source/core/css/resolver/StyleResolver.cpp View 1 2 3 4 5 6 7 1 chunk +12 lines, -0 lines 0 comments Download
M Source/core/dom/ContainerNode.cpp View 1 2 3 4 5 6 7 2 chunks +4 lines, -0 lines 0 comments Download
M Source/core/dom/Document.cpp View 1 2 3 4 5 6 7 2 chunks +5 lines, -1 line 0 comments Download
M Source/core/dom/Element.cpp View 1 2 3 4 5 6 7 1 chunk +2 lines, -0 lines 0 comments Download
M Source/core/html/parser/HTMLConstructionSite.cpp View 1 2 3 4 5 6 7 1 chunk +1 line, -0 lines 0 comments Download
M Source/core/testing/Internals.cpp View 1 2 3 4 5 6 7 2 chunks +11 lines, -0 lines 0 comments Download

Messages

Total messages: 12 (0 generated)
leviw_travelin_and_unemployed
I've looked into the performance of this a ton, and it's complicated. HTML5 full render ...
7 years, 4 months ago (2013-08-20 00:37:18 UTC) #1
esprehn
I dunno what's going on with the parent->document()->document() thing but that looks wrong. Also what ...
7 years, 4 months ago (2013-08-20 00:48:01 UTC) #2
leviw_travelin_and_unemployed
https://chromiumcodereview.appspot.com/23049008/diff/14001/Source/core/css/resolver/SharedStyleFinder.cpp File Source/core/css/resolver/SharedStyleFinder.cpp (right): https://chromiumcodereview.appspot.com/23049008/diff/14001/Source/core/css/resolver/SharedStyleFinder.cpp#newcode286 Source/core/css/resolver/SharedStyleFinder.cpp:286: if (canShareStyleWithElement(context, iter->get())) { On 2013/08/20 00:48:01, esprehn wrote: ...
7 years, 4 months ago (2013-08-20 00:54:09 UTC) #3
leviw_travelin_and_unemployed
The blink trybots aren't very happy today... anyhow, ptal.
7 years, 4 months ago (2013-08-20 05:43:33 UTC) #4
leviw_travelin_and_unemployed
Bump.
7 years, 4 months ago (2013-08-22 17:12:35 UTC) #5
esprehn
Clearing the cache inside updateTreeAfterInsertion doesn't look right, I think you want to clear it ...
7 years, 4 months ago (2013-08-22 17:33:02 UTC) #6
leviw_travelin_and_unemployed
On 2013/08/22 17:33:02, esprehn wrote: > Clearing the cache inside updateTreeAfterInsertion doesn't look right, I ...
7 years, 4 months ago (2013-08-22 22:25:27 UTC) #7
esprehn
On 2013/08/22 22:25:27, Levi wrote: > On 2013/08/22 17:33:02, esprehn wrote: > > Clearing the ...
7 years, 4 months ago (2013-08-22 22:36:59 UTC) #8
leviw_travelin_and_unemployed
On 2013/08/22 22:36:59, esprehn wrote: > If you clear it at the start and end ...
7 years, 4 months ago (2013-08-22 22:57:46 UTC) #9
esprehn
On 2013/08/22 22:57:46, Levi wrote: > On 2013/08/22 22:36:59, esprehn wrote: > > If you ...
7 years, 4 months ago (2013-08-22 23:06:09 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/leviw@chromium.org/23049008/58001
7 years, 3 months ago (2013-09-05 16:01:24 UTC) #11
commit-bot: I haz the power
7 years, 3 months ago (2013-09-05 17:02:12 UTC) #12
Message was sent while issue was closed.
Change committed as 157311

Powered by Google App Engine
This is Rietveld 408576698