Reviewed by Kevin.
authormjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Nov 2004 01:12:18 +0000 (01:12 +0000)
committermjs <mjs@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sat, 13 Nov 2004 01:12:18 +0000 (01:12 +0000)
commit65c4b90269de2ef42024dd337614faa894025653
tree8a942aa04948bf5615642888d6a96e6b7cece02d
parentba016592aaea40b681372d49d080c39f51fd6609
    Reviewed by Kevin.

- fixed <rdar://problem/3878183> Safari is 77% slower than it should be on a page on an IBM website due to NodeListImpl length

I fixed this by changing NodeLists to cache their length, but
invalidate it whenever there is a change in the DOM subtree at
which they are rooted. This makes NodeListImpl::recursiveLength()
drop completely off the profile, since we were repeatedly getting
a length for the same NodeList over and over.

        * khtml/xml/dom_nodeimpl.cpp:
        (NodeImpl::NodeImpl):
        (NodeImpl::~NodeImpl):
        (NodeImpl::registerNodeList):
        (NodeImpl::unregisterNodeList):
        (NodeImpl::notifyLocalNodeListsSubtreeModified):
        (NodeImpl::notifyNodeListsSubtreeModified):
        (NodeImpl::dispatchSubtreeModifiedEvent):
        (NodeListImpl::NodeListImpl):
        (NodeListImpl::~NodeListImpl):
        (NodeListImpl::recursiveLength):
        (NodeListImpl::recursiveItem):
        (NodeListImpl::rootNodeSubtreeModified):
        (ChildNodeListImpl::ChildNodeListImpl):
        (ChildNodeListImpl::length):
        (ChildNodeListImpl::item):
        (TagNodeListImpl::TagNodeListImpl):
        (TagNodeListImpl::length):
        (TagNodeListImpl::item):
        (NameNodeListImpl::NameNodeListImpl):
        (NameNodeListImpl::length):
        (NameNodeListImpl::item):
        * khtml/xml/dom_nodeimpl.h:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@7997 268f45cc-cd09-0410-ab3c-d52691b4dbfc
WebCore/ChangeLog-2005-08-23
WebCore/khtml/xml/dom_nodeimpl.cpp
WebCore/khtml/xml/dom_nodeimpl.h