Bug 114994

Summary: Plugin Snapshotting: Don't consume insane amounts of time detecting the primary plugin
Product: WebKit Reporter: Tim Horton <thorton>
Component: Plug-insAssignee: Tim Horton <thorton>
Status: RESOLVED FIXED    
Severity: Normal CC: dino, sam, simon.fraser
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
patch andersca: review+

Tim Horton
Reported 2013-04-22 15:13:28 PDT
Some pages either have tons of subframes or dynamically add lots of plugins. We're currently wasting a lot of time on every subframe load and every addPluginView doing primary plugin detection. Some things we can do to improve this: * only start detecting after the main frame's didFinishLoad comes. This was intended to be in the original implementation, but we only wait for the first subframe's didFinishLoad instead :| * only explicitly detect on the main frame's didFinishLoad (not subframes) * coalesce calls to determinePrimarySnapshottedPlugInTimerFired from both addPluginView (in case JS is adding lots of plugins in a loop) and didFinishLoad I'm not sure this is a 100% solution, but it should not regress primary plugin detection while improving performance greatly on some pages (http://thelede.blogs.nytimes.com/2013/04/19/updates-on-aftermath-of-boston-marathon-explosions-2/). <rdar://problem/13696269>
Attachments
patch (4.76 KB, patch)
2013-04-22 15:18 PDT, Tim Horton
andersca: review+
Tim Horton
Comment 1 2013-04-22 15:18:11 PDT
Tim Horton
Comment 2 2013-04-22 15:18:21 PDT
Going to test more before landing.
Anders Carlsson
Comment 3 2013-04-22 15:31:49 PDT
Comment on attachment 199117 [details] patch View in context: https://bugs.webkit.org/attachment.cgi?id=199117&action=review > Source/WebKit2/WebProcess/WebPage/WebPage.cpp:3949 > +void WebPage::determinePrimarySnapshottedPlugInTimerFired() > +{ > +#if ENABLE(PRIMARY_SNAPSHOTTED_PLUGIN_HEURISTIC) > + if (!m_page->settings()->snapshotAllPlugIns() && m_page->settings()->primaryPlugInSnapshotDetectionEnabled()) > + determinePrimarySnapshottedPlugIn(); > +#endif > +} You probably want to put the entire function body inside the #if.
Tim Horton
Comment 4 2013-04-22 15:35:53 PDT
Note You need to log in before you can comment on or make changes to this bug.