[Webkit-unassigned] [Bug 66136] New: [DRT] Reduce redundant layout when running test in DRT

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Aug 12 06:56:32 PDT 2011


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

           Summary: [DRT] Reduce redundant layout when running test in DRT
           Product: WebKit
           Version: 528+ (Nightly build)
          Platform: Unspecified
        OS/Version: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Tools / Tests
        AssignedTo: webkit-unassigned at lists.webkit.org
        ReportedBy: jnd at chromium.org
                CC: tony at chromium.org, abarth at webkit.org


Currently in Webkit, DOM and other data changes may call FrameView::scheduleRelayout to schedule a real layout in a timer, current timer interval is 250ms (see cLayoutScheduleThreshold in Document.cpp), the delayed layout mechanism keeps render engineer continuously updating layout (and does not block other components like pasring) instead of rendering it one time (no layout before it), so users can see the layout updated smoothly.

However in DRT, since no one cares about the intermediate layout, the layout calls scheduled by layoutTimer (FrameView::m_layoutTimer) before the final layout looks useless and cost lots of system resources especially CPU resource.
Seems likes some mobile WebKit ports have realize the similar issue, there is a data member called m_extraLayoutDelay added in Document to increase the minimum delay between re-layouts. It is set by setExtraLayoutDelay to modify the minimum delay used at different points during the lifetime of the Document.
Although the API setExtraLayoutDelay is marked as "used by Android", but I think we can use it for all DRT ports to reduce the delayed layout. No worries, the synchronous layout requests are not affected. For example, when script calls element.offsetTop to try to get the position of a element, the document will call updateLayoutIgnorePendingStylesheets to update the layout immediately in order to get the latest position (also it's a unstable position) of element. The API setExtraLayoutDelay is only used to reduce the intermediate layout calls in order to reduce test time/improve DRT performance, it has pretty obvious effect when running layouts on mobile devices. I have test the way on linux, mac, results are pretty good.

Does it sound good? I'd like to get some inputs before sending the patch.

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