Changeset 79781 in webkit


Ignore:
Timestamp:
Feb 26, 2011 5:59:36 AM (13 years ago)
Author:
eric@webkit.org
Message:

2011-02-26 Eric Seidel <eric@webkit.org>

Reviewed by Maciej Stachowiak.

malloc in removeChildren shows up on profile of peacekeeper domDynamicCreationCreateElement
https://bugs.webkit.org/show_bug.cgi?id=55204

  • dom/ContainerNode.cpp: (WebCore::ContainerNode::removeChildren):
    • Using an inlineCapacity of 10 for now. We may want to tweak it later.
    • This removes yet another malloc from code which removes nodes (which is rather common).
Location:
trunk/Source/WebCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r79780 r79781  
     12011-02-26  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Maciej Stachowiak.
     4
     5        malloc in removeChildren shows up on profile of peacekeeper domDynamicCreationCreateElement
     6        https://bugs.webkit.org/show_bug.cgi?id=55204
     7
     8        * dom/ContainerNode.cpp:
     9        (WebCore::ContainerNode::removeChildren):
     10         - Using an inlineCapacity of 10 for now. We may want to tweak it later.
     11         - This removes yet another malloc from code which removes nodes (which is rather common).
     12
    1132011-02-26  Eric Seidel  <eric@webkit.org>
    214
  • trunk/Source/WebCore/bindings/js/JSCSSStyleDeclarationCustom.cpp

    r72833 r79781  
    136136static bool isCSSPropertyName(const Identifier& propertyName)
    137137{
     138    // FIXME: This mallocs a string for the property name and then throws it
     139    // away.  This shows up on peacekeeper's domDynamicCreationCreateElement.
    138140    return CSSStyleDeclaration::isPropertyName(cssPropertyName(propertyName));
    139141}
  • trunk/Source/WebCore/dom/ContainerNode.cpp

    r74101 r79781  
    356356void ContainerNode::willRemove()
    357357{
    358     NodeVector nodes;
     358    Vector<RefPtr<Node>, 10> nodes;
     359    nodes.reserveInitialCapacity(childNodeCount());
    359360    for (Node* n = m_lastChild; n; n = n->previousSibling())
    360361        nodes.append(n);
     
    513514
    514515    forbidEventDispatch();
    515     Vector<RefPtr<Node> > removedChildren;
     516    Vector<RefPtr<Node>, 10> removedChildren;
     517    removedChildren.reserveInitialCapacity(childNodeCount());
    516518    while (RefPtr<Node> n = m_firstChild) {
    517519        Node* next = n->nextSibling();
    518        
     520
    519521        // Remove the node from the tree before calling detach or removedFromDocument (4427024, 4129744).
    520522        // removeChild() does this after calling detach(). There is no explanation for
Note: See TracChangeset for help on using the changeset viewer.