Bug 101410

Summary: Wikipedia articles layout 20 times during load
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: Layout and RenderingAssignee: Nobody <webkit-unassigned>
Status: REOPENED ---    
Severity: Normal CC: bdakin, eric, hyatt, koivisto, mitz, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
dtrace script for counting layouts
none
Fixed script
none
dtrace script for counting layouts -- with recursion guard and more precision none

Description Geoffrey Garen 2012-11-06 16:41:46 PST
Created attachment 172676 [details]
dtrace script for counting layouts

STEPS TO REPRODUCE:
1. Go to http://en.wikipedia.org/wiki/Steve_jobs
--> ~16000 layouts

2. Go to http://en.wikipedia.org/wiki/Banksia_ilicifolia
--> ~4000 layouts

I'm attaching a dtrace script I used to count layouts.
Comment 1 Geoffrey Garen 2012-11-06 16:43:10 PST
<rdar://problem/12649626>
Comment 2 Simon Fraser (smfr) 2012-11-06 16:48:17 PST
printf shows about 20 layouts loading http://en.wikipedia.org/wiki/Steve_jobs. Ur script is bad.
Comment 3 Simon Fraser (smfr) 2012-11-06 17:01:00 PST
Created attachment 172678 [details]
Fixed script

Previous script matched every FrameView*layout* method, like FrameView::layoutRoot(). Even the current script doesn't detect when we bail early from layout().
Comment 4 Geoffrey Garen 2012-11-07 10:45:14 PST
OK. 20 is still a lot more than 1. Instruments shows that 80% of wikipedia article load time is layout. Is there some improvement we can make here?
Comment 5 Antti Koivisto 2012-11-07 12:16:51 PST
There are surely improvements we can make but 1 layout is not a realistic expectation for a page that does dynamic style manipulation during loading.
Comment 6 Geoffrey Garen 2012-11-07 12:29:00 PST
Created attachment 172859 [details]
dtrace script for counting layouts -- with recursion guard and more precision

Added recursion guard.