When distributing, we're currently traversing all descendant nodes in ShadowDOM. If we cache InsertionPoint List, we can skip a lot of traversal.
Created attachment 175920 [details] Patch
Comment on attachment 175920 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=175920&action=review > Source/WebCore/dom/ShadowRoot.h:106 > + bool hasValidDescendentInsertionPointList() const; s/descendent/descendant/ I think it can be simply called insertionPoints or insertionPointList. > Source/WebCore/dom/ShadowRoot.h:191 > + ASSERT(hasValidDescendentInsertionPointList()); We can ensure() the list here considering that all call sites calls ensure() before calling this.
Created attachment 175952 [details] Patch
Created attachment 175964 [details] Patch
Comment on attachment 175964 [details] Patch This patch cannot be applied to ToT. We have to resolve Bug 103481 at first.
Comment on attachment 175964 [details] Patch This is great!
Created attachment 176630 [details] Patch
Comment on attachment 176630 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=176630&action=review If you have a microbenchmark for this change, let's commit them first and mention its improvement on the ChangeLog. It would be good for the record. > Source/WebCore/dom/ShadowRoot.cpp:320 > + distributionData()->setInsertionPointListValidity(true); Let's move the implementation to DistributionData. > Source/WebCore/dom/ShadowRoot.cpp:350 > + distributionData()->clearInsertionPointList(); Ditto.
Created attachment 176637 [details] Patch
(In reply to comment #8) > (From update of attachment 176630 [details]) > View in context: https://bugs.webkit.org/attachment.cgi?id=176630&action=review > > If you have a microbenchmark for this change, let's commit them first and mention its improvement on the ChangeLog. > It would be good for the record. > > > Source/WebCore/dom/ShadowRoot.cpp:320 > > + distributionData()->setInsertionPointListValidity(true); > > Let's move the implementation to DistributionData. > > > Source/WebCore/dom/ShadowRoot.cpp:350 > > + distributionData()->clearInsertionPointList(); > > Ditto. Done.
Comment on attachment 176637 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=176637&action=review > Source/WebCore/dom/ShadowRoot.cpp:354 > + invalidateInsertionPointList(); These invalidateInsretionPointList() calls also can be in DistributionData > Source/WebCore/dom/ShadowRoot.h:133 > + void ensureValidInsertionPointList(); Then we can kill this.
Comment on attachment 176637 [details] Patch Attachment 176637 [details] did not pass chromium-ews (chromium-xvfb): Output: http://queues.webkit.org/results/15018708
Comment on attachment 176637 [details] Patch Attachment 176637 [details] did not pass qt-ews (qt): Output: http://queues.webkit.org/results/15015715
Comment on attachment 176637 [details] Patch Attachment 176637 [details] did not pass qt-wk2-ews (qt): Output: http://queues.webkit.org/results/15027676
Comment on attachment 176637 [details] Patch Attachment 176637 [details] did not pass mac-ews (mac): Output: http://queues.webkit.org/results/15015719
Created attachment 176645 [details] Patch for landing
Comment on attachment 176645 [details] Patch for landing Clearing flags on attachment: 176645 Committed r136098: <http://trac.webkit.org/changeset/136098>
All reviewed patches have been landed. Closing bug.