[Webkit-unassigned] [Bug 18282] WebKit crashes with deeply nested divs

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 31 04:14:01 PDT 2010


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





--- Comment #35 from TAMURA, Kent <tkent at chromium.org>  2010-03-31 04:14:00 PST ---
Created an attachment (id=52149)
 --> (https://bugs.webkit.org/attachment.cgi?id=52149)
Performance checker

With this test code:

Iteration=4000 depth=200
No patch: 4,633
DOMTREE_RUNTIME_MAXDEPTH: 4,878 (4.6% time gain)

Iteration=500 depth=1000
No patch: 7,353
DOMTREE_RUNTIME_MAXDEPTH: 8,023 (9.1% time gain)

Iteration=30 depth=4000
No patch: 5,747
DOMTREE_RUNTIME_MAXDEPTH: 6,662 (15.9% time gain)

Hmm, DOMTREE_RUNTIME_MAXDEPTH is not acceptable.


I have an idea to improve performance. How about introducing just one cache of
a node depth?
Suppose that:
 Document has m_lastDepth and m_lastDepthNode. They have information about a
parent node which was used in the last node insertion.
 When another child node is inserted to a parent node P,
  - If P is m_lastDepthNode, m_lastDepth is the depth
  - If P's parent is m_lastDepthNode, m_lastDepth++ and m_lastDepthNode = P
  - If m_lastDepthNode's parent is P, m_lastDepth-- and m_lastDepthNode = P
  - If P's parent is m_lastDepthNode's parent, m_lastDepthNode = P
This reduces a lot of depth calculation.

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