[Webkit-unassigned] [Bug 73853] Inserting nodes is slow due to Node::notifyNodeListsAttributeChanged (20%+)

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Dec 19 12:23:49 PST 2011


https://bugs.webkit.org/show_bug.cgi?id=73853





--- Comment #17 from Ryosuke Niwa <rniwa at webkit.org>  2011-12-19 12:23:49 PST ---
Good and bad news everyone:

The good news is that my patch have successfully eliminated invalidateCaches from the profiler. The bad news is that new profile result indicates our hashmap/hashset may not be as efficient as it should be. In fact, we seem to spend 30-50% of time in hashmap/hashset at the moment. And the time we spend in them increase linearly with respect to the number of nodes inserted.

New profile result:
    4.5%    238    WebCore    WebCore::createHTMLSpanElementWrapper(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WTF::PassRefPtr<WebCore::HTMLElement>)
    0.0%    237    WebCore     WebCore::createJSHTMLWrapper(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WTF::PassRefPtr<WebCore::HTMLElement>)
    0.0%    237    WebCore      WebCore::toJSNewlyCreated(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WebCore::Element*)
    0.0%    237    WebCore       WebCore::jsDocumentPrototypeFunctionCreateElement(JSC::ExecState*)
    0.0%    237    Unknown Library        0x239a85c01538 [unknown]
    0.0%    1    WebCore     WebCore::toJSNewlyCreated(JSC::ExecState*, WebCore::JSDOMGlobalObject*, WebCore::Element*)
    4.0%    213    WebCore    WebCore::JSNodeOwner::finalize(JSC::Handle<JSC::Unknown>, void*)
    0.0%    213    JavaScriptCore     JSC::HandleHeap::finalizeWeakHandles()
    0.0%    4    WebProcess      0xbea [unreadable]
    4.0%    212    WebCore    WebCore::QualifiedName::init(WTF::AtomicString const&, WTF::AtomicString const&, WTF::AtomicString const&)
    0.0%    207    WebCore     WebCore::HTMLDocument::createElement(WTF::AtomicString const&, int&)
    0.0%    207    WebCore      WebCore::jsDocumentPrototypeFunctionCreateElement(JSC::ExecState*)
    0.0%    207    Unknown Library       0x239a85c01538 [unknown]
    0.0%    5    WebCore     WebCore::jsDocumentPrototypeFunctionCreateElement(JSC::ExecState*)
    3.1%    166    JavaScriptCore    WTF::AtomicString::addSlowCase(WTF::StringImpl*)
    0.0%    153    Unknown Library     0x1140469f8 [unknown]
    0.0%    8    Unknown Library     0x239a85c01538 [unknown]
    0.0%    3    WebCore     WebCore::jsDocumentPrototypeFunctionCreateElement(JSC::ExecState*)
    0.0%    1    WebCore     WebCore::HTMLDocument::createElement(WTF::AtomicString const&, int&)
    0.0%    1    Unknown Library     0x1140469d0 [unknown]
    3.1%    164    WebCore    WebCore::JSNodeOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown>, void*, JSC::SlotVisitor&)
    0.0%    161    JavaScriptCore     JSC::HandleHeap::visitWeakHandles(JSC::HeapRootVisitor&)
    0.0%    3    WebProcess     0x1000000 [unreadable]
    2.3%    124    WebCore    WebCore::jsDocumentPrototypeFunctionCreateElement(JSC::ExecState*)
    2.1%    114    JavaScriptCore    WTF::TCMalloc_Central_FreeList::FetchFromSpansSafe()
    2.0%    106    WebCore    WebCore::TreeScope::clearNodeListCaches(WebCore::DynamicSubtreeNodeListType)
    0.0%    83    WebCore     WebCore::TreeScope::clearNodeListCachesForAllTypes()
    0.0%    23    WebCore     WebCore::Element::childrenChanged(bool, WebCore::Node*, WebCore::Node*, int)
    1.9%    102    WebCore    WTF::HashMap<WTF::AtomicStringImpl*, WTF::PassRefPtr<WebCore::HTMLElement> (*)(WebCore::QualifiedName const&, WebCore::Document*, WebCore::HTMLFormElement*, bool), WTF::PtrHash<WTF::AtomicStringImpl*>, WTF::HashTraits<WTF::AtomicStringImpl*>, WTF::HashTraits<WTF::PassRefPtr<WebCore::HTMLElement> (*)(WebCore::QualifiedName const&, WebCore::Document*, WebCore::HTMLFormElement*, bool)> >::get(WTF::AtomicStringImpl* const&) const
    1.9%    102    WebCore    WebCore::ContainerNode::insertBefore(WTF::PassRefPtr<WebCore::Node>, WebCore::Node*, int&, bool)
    0.0%    99    WebCore     WebCore::Node::insertBefore(WTF::PassRefPtr<WebCore::Node>, WebCore::Node*, int&, bool)
    0.0%    99    WebCore      WebCore::JSNode::insertBefore(JSC::ExecState*)
    0.0%    99    WebCore       WebCore::jsNodePrototypeFunctionInsertBefore(JSC::ExecState*)
    0.0%    3    WebCore     WebCore::JSNode::insertBefore(JSC::ExecState*)
    1.9%    99    JavaScriptCore    WTF::StringImpl::lower()
    1.9%    99    WebCore    WTF::HashMap<JSC::ClassInfo const*, JSC::WriteBarrier<JSC::Structure>, WTF::PtrHash<JSC::ClassInfo const*>, WTF::HashTraits<JSC::ClassInfo const*>, WTF::HashTraits<JSC::WriteBarrier<JSC::Structure> > >::get(JSC::ClassInfo const* const&) const
    1.7%    93    WebCore    WebCore::ContainerNode::appendChild(WTF::PassRefPtr<WebCore::Node>, int&, bool)
    1.7%    89    WebCore    void WebCore::Private::addChildNodesToDeletionQueue<WebCore::Node, WebCore::ContainerNode>(WebCore::Node*&, WebCore::Node*&, WebCore::ContainerNode*)
    1.7%    88    WebCore    WebCore::HTMLDocument::createElement(WTF::AtomicString const&, int&)
    1.6%    87    JavaScriptCore    WTF::fastMalloc(unsigned long)
    1.4%    75    WebCore    WebCore::notifyChildInserted(WebCore::Node*)

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list