Changeset 116203 in webkit


Ignore:
Timestamp:
May 4, 2012 7:17:15 PM (12 years ago)
Author:
jchaffraix@webkit.org
Message:

Leaf non self-painting layers should bail out early in RenderLayer::paintLayer
https://bugs.webkit.org/show_bug.cgi?id=85678

Reviewed by Darin Adler.

Performance optimization, no expected change in behavior.

The gist of the change is that leaf non self-painting layers don't need to be painted as their
associated RenderBoxModelObject should properly paint itself without any help.

For RenderLayer trees that have a large number of leafs nodes (like a table with a leaf RenderLayer for
each cells), not bailing out is a big overhead as it ends up doing a lot of computation for no real
painting. See http://dglazkov.github.com/performance-tests/biggrid.html for a benchmark for that. On
my machine, it reduces the paint time when scrolling to 70ms from 120ms (45% speedup).

  • rendering/RenderLayer.cpp:

(WebCore::RenderLayer::paintLayer):

Location:
trunk/Source/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r116202 r116203  
     12012-05-04  Julien Chaffraix  <jchaffraix@webkit.org>
     2
     3        Leaf non self-painting layers should bail out early in RenderLayer::paintLayer
     4        https://bugs.webkit.org/show_bug.cgi?id=85678
     5
     6        Reviewed by Darin Adler.
     7
     8        Performance optimization, no expected change in behavior.
     9
     10        The gist of the change is that leaf non self-painting layers don't need to be painted as their
     11        associated RenderBoxModelObject should properly paint itself without any help.
     12
     13        For RenderLayer trees that have a large number of leafs nodes (like a table with a leaf RenderLayer for
     14        each cells), not bailing out is a big overhead as it ends up doing a lot of computation for no real
     15        painting. See http://dglazkov.github.com/performance-tests/biggrid.html for a benchmark for that. On
     16        my machine, it reduces the paint time when scrolling to 70ms from 120ms (45% speedup).
     17
     18        * rendering/RenderLayer.cpp:
     19        (WebCore::RenderLayer::paintLayer):
     20
    1212012-05-04  Rob Buis  <rbuis@rim.com>
    222
  • trunk/Source/WebCore/rendering/RenderLayer.cpp

    r116003 r116203  
    29012901        return;
    29022902
     2903    // Non self-painting leaf layers don't need to be painted as their renderer() should properly paint itself.
     2904    if (!isSelfPaintingLayer() && !firstChild())
     2905        return;
     2906
    29032907    if (paintsWithTransparency(paintBehavior))
    29042908        paintFlags |= PaintLayerHaveTransparency;
Note: See TracChangeset for help on using the changeset viewer.