[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 5 16:20:29 PST 2011


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





--- Comment #3 from Sam Weinig <sam at webkit.org>  2011-12-05 16:20:29 PST ---
If this is the call to notifyNodeListsAttributeChanged() from Node::dispatchSubtreeModifiedEvent() (and I think it probably is) there is this comment:

    notifyNodeListsAttributeChanged(); // FIXME: Can do better some day. Really only care about the name attribute changing.

Not sure if that is still true, but it is telling.

The most obvious optimization that comes to mind is keeping a bit on the Document noting if there are any NodeLists that need to be invalidated (like we do with certain event listeners).  The effectiveness of that optimization would be dependent on how many pages use NamedNodeLists and/or ClassNodeList.

A better approach is probably to look at the callers to dispatchSubtreeModifiedEvent(), and see how many of them know that these caches don't need to be invalidated.  The one in CharacterData, for instance, probably knows that those node lists can't have changed.

-- 
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