RESOLVED FIXED 136957
Minimize virtual function calls in MarkupAccumulator
https://bugs.webkit.org/show_bug.cgi?id=136957
Summary Minimize virtual function calls in MarkupAccumulator
Chris Dumez
Reported 2014-09-19 11:37:40 PDT
We can minimize the number of virtual function calls in MarkupAccumulator by: - De-virtualizing MarkupAccumulator::appendString(), which is never overridden - Having MarkupAccumulator::appendEndTag() take an Element in argument instead of a Node, as it only applies to Element. This will force callers to do the isElementNode() check *before* calling the virtual function, instead of calling appendEndTag() unconditionally and have it return early.
Attachments
Patch (9.17 KB, patch)
2014-09-19 11:40 PDT, Chris Dumez
no flags
Patch (7.16 KB, patch)
2014-09-19 16:25 PDT, Chris Dumez
no flags
Chris Dumez
Comment 1 2014-09-19 11:40:33 PDT
Benjamin Poulain
Comment 2 2014-09-19 13:19:38 PDT
Comment on attachment 238380 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=238380&action=review > Source/WebCore/page/PageSerializer.cpp:109 > - virtual void appendEndTag(const Node&) override; > + virtual void appendEndTag(const Element&) override; Instead of adding isElementNode() everywhere, you could have: inline void appendEndTag(Node& node) { if (node.isElementNode()) appendEndTag(toElement(node)); }
Chris Dumez
Comment 3 2014-09-19 16:25:30 PDT
WebKit Commit Bot
Comment 4 2014-09-19 17:11:57 PDT
Comment on attachment 238396 [details] Patch Clearing flags on attachment: 238396 Committed r173783: <http://trac.webkit.org/changeset/173783>
WebKit Commit Bot
Comment 5 2014-09-19 17:12:04 PDT
All reviewed patches have been landed. Closing bug.
Note You need to log in before you can comment on or make changes to this bug.