Changeset 110358 in webkit
- Timestamp:
- Mar 9, 2012 6:22:48 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r110356 r110358 1 2012-03-09 Stephen White <senorblanco@chromium.org> 2 3 Improve ContainerNode collectNode() performance by reserving vector 4 capacity up front. 5 https://bugs.webkit.org/show_bug.cgi?id=80706 6 7 Reviewed by Ryosuke Niwa. 8 9 Covered by existing tests. Performance will be evaluated based on 10 Chromium's page_cycler_bloat-http, page_cycler_intl1, and 11 dromaeo_domcore suites. 12 13 * dom/ContainerNode.cpp: 14 (WebCore::collectNodes): 15 1 16 2012-03-09 Dan Bernstein <mitz@apple.com> 2 17 -
trunk/Source/WebCore/dom/ContainerNode.cpp
r110320 r110358 27 27 #include "ContainerNodeAlgorithms.h" 28 28 #include "DeleteButtonController.h" 29 #include "DocumentFragment.h" 29 30 #include "EventNames.h" 30 31 #include "ExceptionCode.h" … … 62 63 static bool s_shouldReEnableMemoryCacheCallsAfterAttach; 63 64 64 static inline void collectNodes(Node* node, NodeVector& nodes) 65 { 65 static inline void collectNodes(ContainerNode* node, NodeVector& nodes) 66 { 67 nodes.reserveCapacity(nodes.size() + node->childNodeCount()); 66 68 for (Node* child = node->firstChild(); child; child = child->nextSibling()) 67 69 nodes.append(child); … … 74 76 return; 75 77 } 76 collectNodes( node, nodes);78 collectNodes(static_cast<DocumentFragment*>(node), nodes); 77 79 } 78 80
Note: See TracChangeset
for help on using the changeset viewer.