[Webkit-unassigned] [Bug 55626] New: Node::attach() and Node::nextRenderer() account for over 50% of Peacekeeper's domDynamicCreationCreateElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Mar 2 15:39:05 PST 2011


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

           Summary: Node::attach() and Node::nextRenderer() account for
                    over 50% of Peacekeeper's
                    domDynamicCreationCreateElement
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: PC
        OS/Version: Mac OS X 10.5
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: eric at webkit.org
                CC: mjs at apple.com, darin at apple.com, mitz at webkit.org,
                    aestes at apple.com


Node::attach() and Node::nextRenderer() account for over 50% of Peacekeeper's domDynamicCreationCreateElement

At least according to my latest shark samples.

80% of that time is spent in the JNZ instruction caused by "if (node->renderer())" in the "walk my siblings for renderer" loops in both functions.  I suspect we're just stalling hard, as the hardware isn't able to predict what memory to pre-fetch for the linked list walk.

Maciej suggested one way to prevent this might be to use beforeRenderer() instead, since that's more likely to be already set than nextRenderer.

It's also possible that lazyAttach() is defeating this optimization in nextRenderer:
    if (parentOrHostNode() && !parentOrHostNode()->attached())
        return 0;

However I tried adding a !parentOrHostNode()->renderer() check into that if an saw no change in the benchmark results.

This did not show up in my previous testing, as my hacked copy of peacekeeper was using display: none.  Looks like the real one doesn't do that. :)

The linked-list walk in attach() came from https://bugs.webkit.org/show_bug.cgi?id=14134.  The nextRenderer() walk has been with us forever.

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