Bug 90695

Summary: Performance: 2D Canvas rendering spending a lot of CPU time in RenderLayerCompositor::updateLayerCompositingState
Product: WebKit Reporter: Justin Novosad <junov>
Component: CanvasAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: jamesr, senorblanco, simon.fraser, vangelis
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   

Description Justin Novosad 2012-07-06 10:14:00 PDT
While profiling Chrome, executing the benchmark page found here:
https://github.com/sibblingz/PerfMarks

A hot spot was detected detected in RenderLayerCompositor::updateLayerCompositingState (mostly in updateGraphicsLayerConfiguration()), which appears to be called once for every 2D canvas primitive draw.
For some of the sub tests of this benchmark, as much as 20% of CPU time can be spent in that function.  Since canvas draws do not impact the layout of composited layers, there should be no need to visit this code so often.

Related bug: https://bugs.webkit.org/show_bug.cgi?id=90630
Comment 1 Justin Novosad 2012-07-06 11:08:06 PDT
fixed by r121987: <http://trac.webkit.org/changeset/121987>

The call to RenderLayerCompositor::updateLayerCompositingState is now bypassed when contentChanged() is called with CanvasPixelsChanged rather than CanvasChanged.