RESOLVED DUPLICATE of bug 118300 117637
Improve the number of style resolutions for NodeRenderingContext
https://bugs.webkit.org/show_bug.cgi?id=117637
Summary Improve the number of style resolutions for NodeRenderingContext
Mihai Maerean
Reported 2013-06-14 05:43:21 PDT
Answer Simon Fraser's concerns raised on https://bugs.webkit.org/show_bug.cgi?id=74144 that there could be less calls to styleForRenderer() in NodeRenderingContext.
Attachments
patch (3.87 KB, patch)
2013-06-17 05:51 PDT, Mihai Maerean
simon.fraser: review-
Mihai Maerean
Comment 1 2013-06-17 05:51:00 PDT
Created attachment 204813 [details] patch This patch reduces the number of style resolutions (an expensive operation) by checking for moveToFlowThreadIfNeeded in 2 steps: * 1st step: we determine if the node is the child of a region. * 2nd step: after calling shouldCreateRenderer, we call moveToFlowThreadIfNeeded for all other nodes and, by that time, the style has already been computed. The number of style resolutions are as follows: WHEN OPENING STYLE RESOLUTIONS WITH THE _OLD_ CODE STYLE RESOLUTIONS WITH THE _PATCH_ http://www.whitehouse.gov/ 4027 3257 http://en.wikipedia.org/wiki/Main_Page 7513 5638 The results of running PerformanceTests/Parser/ are as follows: TEST UNIT NEW CODE DELTA OLD CODE /Parser/textarea-parsing:Runs runs/s 77.32 5.72% BETTER 73.14 /Parser/tiny-innerHTML:Runs runs/s 3.65 4.81% BETTER 3.48 /Parser/html-parser:Time ms 2423.15 0.49% BETTER 2435.15 /Parser/css-parser-yui:Runs runs/s 280.09 0.44% BETTER 278.87 /Parser/xml-parser:Runs runs/s 6.08 4.85% WORSE 6.39 /Parser/innerHTML-setter:Runs runs/s 185.71 4.61% WORSE 194.69
Simon Fraser (smfr)
Comment 2 2013-06-17 08:51:35 PDT
Comment on attachment 204813 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=204813&action=review I find it very hard to follow this code, because both Element and NodeRenderContext have moveToFlowThread* functions. I think some renaming first would improve understanding of the code. > Source/WebCore/dom/NodeRenderingContext.cpp:250 > + bool haveTestedForMoveToFlowThread = false; > + for (const Element* parentElement = m_node->parentElement(); parentElement; parentElement = parentElement->parentElement()) { You're adding a parent-chain walk here, which I assume will kick in for every renderer creation, which is bad too.
Radu Stavila
Comment 3 2013-07-02 13:43:28 PDT
Considering https://bugs.webkit.org/show_bug.cgi?id=118300, is this issue still valid?
Mihai Maerean
Comment 4 2013-07-02 23:24:39 PDT
*** This bug has been marked as a duplicate of bug 118300 ***
Note You need to log in before you can comment on or make changes to this bug.