[Webkit-unassigned] [Bug 87034] treeScope() is too slow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon May 21 17:53:41 PDT 2012


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





--- Comment #2 from Hajime Morrita <morrita at google.com>  2012-05-21 17:52:43 PST ---
(In reply to comment #0)
> We spend roughly 8% of time in treeScope() while loading https://bugs.webkit.org/attachment.cgi?id=142634&action=review
> because treeScope() uses rareData(), which uses HashMap lookup.
> 
> Not only that, this method appeared on almost every single profiling I did with DOM methods.
> We need to make treeScope() O(1).

Just for clarification: You are saying that O(1) isn't enough, right?
Hashtable lookup is usually considered as O(1) operation.

My current thought is:
- We could replace Node::m_document with Node::m_treeScope. But it could introduce
  some type checking which can regress speed from other side.
- We could get rid of treeScope() usage from the host path.

treeScope() uses rareData() only if the node is in shadow tree,
it happens only with form controls and a few others for builtin element.
I wonder what triggers the actual table lookup.

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