Bug 70009

Summary: 16% of total time loading html5 spec (PerformanceTests/Parser/html5-full-render.html) is spent under updateWidgetIfNecessary
Product: WebKit Reporter: Eric Seidel (no email) <eric>
Component: WebKit Misc.Assignee: Eric Seidel (no email) <eric>
Status: NEW ---    
Severity: Normal CC: abarth, ap, dglazkov, esprehn, kling, koivisto, laszlo.gombos, mario.bensi, simon.fraser, tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 45049    
Bug Blocks: 68944    
Description Flags
Patch eric: review-, webkit.review.bot: commit-queue-

Description Eric Seidel (no email) 2011-10-13 01:53:44 PDT
16% of total time loading html5 spec (PerformanceTests/Parser/html5-full-render.html) is spent under updateWidgetIfNecessary

Running (Self)		Symbol Name
4690.0ms   21.7%	 	             WebCore::HTMLConstructionSite::insertHTMLElement(WebCore::AtomicHTMLToken&)
4546.0ms   21.0%	 	              WTF::PassRefPtr<WebCore::Element> WebCore::HTMLConstructionSite::attach<WebCore::Element>(WebCore::ContainerNode*, WTF::PassRefPtr<WebCore::Element>)
4348.0ms   20.1%	 	               WebCore::Element::attach()
3491.0ms   16.1%	 	                WebCore::ContainerNode::resumePostAttachCallbacks()
3486.0ms   16.1%	 	                 WebCore::ContainerNode::dispatchPostAttachCallbacks()
3485.0ms   16.1%	 	                  WebCore::HTMLPlugInImageElement::updateWidgetIfNecessary()
3485.0ms   16.1%	 	                   WebCore::Document::updateStyleIfNeeded()
3485.0ms   16.1%	 	                    WebCore::Document::recalcStyle(WebCore::Node::StyleChange)

basically we're updating style more often than we need to due to *two* <object> tags in the spec.

Post attach-callbacks for the loss.
Comment 1 Eric Seidel (no email) 2011-10-13 02:21:47 PDT
Created attachment 110814 [details]
Comment 2 WebKit Review Bot 2011-10-13 03:07:59 PDT
Comment on attachment 110814 [details]

Attachment 110814 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/10056165

New failing tests:
Comment 3 Simon Fraser (smfr) 2011-10-13 08:20:03 PDT
Comment on attachment 110814 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=110814&action=review

> Source/WebCore/html/HTMLPlugInImageElement.cpp:171
>      if (!needsWidgetUpdate() || useFallbackContent() || isImageType())

Do any of these require that style has been updated?
Comment 4 Adam Barth 2011-10-13 11:37:27 PDT
> Do any of these require that style has been updated?

I asked Eric that last night and he said no.
Comment 5 Alexey Proskuryakov 2011-10-13 11:50:24 PDT
The test failure on EWS looks related to the change.
Comment 6 Eric Seidel (no email) 2011-10-13 11:58:34 PDT
Must be one of them.  I will revert the change.

I guess that's why I shouldn't write changes at 2am. :)
Comment 7 Adam Barth 2011-10-13 12:12:26 PDT
> I will revert the change.

The change never landed, as far as I can tell.
Comment 8 Eric Seidel (no email) 2011-10-18 15:18:32 PDT
Comment on attachment 110814 [details]

This patch can't work it seems.  I'm not sure what race the current code is depending on, but removing this style update will cause the load never to get kicked off for an <object> tag, and thus not correctly delay the onload event for the window, causing the getSVGDocument() test to fail.
Comment 9 Eric Seidel (no email) 2011-10-18 15:19:33 PDT
I spent some time investigating if I could disentangle the load from the renderer to no avail.  I'll come back to this, but after I finish NRWT.  This is part of the general idea of finally making display: none plugins load properly.