[Webkit-unassigned] [Bug 17510] Acid3 test 26 takes >33ms

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri May 23 21:17:19 PDT 2008


http://bugs.webkit.org/show_bug.cgi?id=17510





------- Comment #26 from mjs at apple.com  2008-05-23 21:17 PDT -------
Some optimization ideas:

1) stringProtoFuncMatch spends 3.4% of its time calling jsString inside
RegExpObjectImp::arrayOfMatches to generate the match array. But nothing in the
test uses the match array, except to test if it is null or not. So, we could
make a special lazy array subclass that fills in the array only if you request
any of the matches. (Total time in stringProtoFuncMatch is 6.8%, there could be
more to juice here - also, since this is the major source of garbage strings,
it should reduce all the time we are spending in StringImp::~StringImp.

2) 1% of time is spent in KJS::resolve_skip, likely much of this is retrieving
the global "document" property, though some of it is "Date". Since "document"
is DontDelete and very commonly accessed, we could create it at the time the
Window is created and statically put it in a var slot much like the Math
object.

3) JSNode::getOwnPropertySlot and JSEventTarget::getOwnPropertySlot show up
with self time, but are always called from a parent - should proably be
inlined.

4) 0.2% of time calling strlen making a String from a char* in
Node::textContent. Yuck. We should pre-make these strings.

5) 0.7% in Node::isReadOnlyNode(). This is solely to support entity and entity
reference nodes in the DOM. But we expand entities so this doesn't normally
even happen. So it sucks that we have to do this expensive check always at DOM
mutation time. Unfortunately there are no spare bits in Node. However, Element
has a 3-bit bitfield, so we could move a flag that only applies to Element
(such as m_tabIndexSetExplicitly) and then have an m_readOnly flag which is set
only for EntityReference and Entity nodes (they will never have children so no
need to do propagation to their descendants). Alternately we could just make
isReadOnlyNode inline and always returning false.


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



More information about the webkit-unassigned mailing list