DescriptionReplace 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 #
Messages
Total messages: 12 (0 generated)
|