Show
Ignore:
Timestamp:
04/22/07 01:23:55 (21 months ago)
Author:
ap
Message:

Reviewed by Darin.

http://bugs.webkit.org/show_bug.cgi?id=13115
REGRESSION: 1000% performance regression in DOM access by index, which was already slow

  • dom/NodeList.h: Move cached data into a separate class, so it can be shared.
  • dom/Node.h: Replace the set of registered NodeLists with a struct that also contains a shared NodeList::Caches (so the size of Node doesn't change).
  • dom/NodeList.cpp: (WebCore::NodeList::NodeList): (WebCore::NodeList::~NodeList): (WebCore::NodeList::recursiveLength): (WebCore::NodeList::itemForwardsFromCurrent): (WebCore::NodeList::itemBackwardsFromCurrent): (WebCore::NodeList::recursiveItem): (WebCore::NodeList::itemWithName): (WebCore::NodeList::rootNodeChildrenChanged): (WebCore::NodeList::NodeListInfo::NodeListInfo): (WebCore::NodeList::NodeListInfo::reset):
  • dom/ChildNodeList.cpp: (WebCore::ChildNodeList::ChildNodeList): (WebCore::ChildNodeList::length): (WebCore::ChildNodeList::item): (WebCore::ChildNodeList::nodeMatches):
  • dom/ChildNodeList.h:
  • dom/Node.cpp: (WebCore::Node::childNodes): (WebCore::Node::registerNodeList): (WebCore::Node::unregisterNodeList): (WebCore::Node::notifyLocalNodeListsAttributeChanged): (WebCore::Node::notifyLocalNodeListsChildrenChanged): Adjust for the above changes.
Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/dom/Node.h

    r20214 r21003  
    4646class NamedAttrMap; 
    4747class NodeList; 
     48struct NodeListsNodeData; 
    4849class PlatformKeyboardEvent; 
    4950class PlatformMouseEvent; 
     
    457458 
    458459protected: 
    459     typedef HashSet<NodeList*> NodeListSet; 
    460     NodeListSet* m_nodeLists; 
     460    NodeListsNodeData* m_nodeLists; 
    461461 
    462462    short m_tabIndex;