[webkit-reviews] review requested: [Bug 81076] Region::intersects() and Region::contains() are slow due to copy overhead : [Attachment 139579] Patch
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Mon Apr 30 21:59:21 PDT 2012
Dana Jansens <danakj at chromium.org> has asked for review:
Bug 81076: Region::intersects() and Region::contains() are slow due to copy
overhead
https://bugs.webkit.org/show_bug.cgi?id=81076
Attachment 139579: Patch
https://bugs.webkit.org/attachment.cgi?id=139579&action=review
------- Additional Comments from Dana Jansens <danakj at chromium.org>
Rebased, and moved the Region::compareRegions function to
Region::Shape::compareShapes, so that ShapeOpertions' trySimpleOperation can
make use of it - specifically, union can make a simple case when
shape2.contains(shape1) by setting result to shape2.
Some motivation:
We have a test case with 500 composited divs that are constantly moved. The
Region class becomes the most expensive thing in the stack in this case.
The test case:
http://chromium.googlecode.com/issues/attachment?aid=1246870000000&name=absolut
e-divs.html&token=KOhmGHsHqUSprb_Hk0wlH3M9UJc%3A1335840366548
Comes from bug: http://code.google.com/p/chromium/issues/detail?id=124687
The Region::intersects() test becomes a hotspot in the code to compute the
overlap map for composited layers, due to copying Region overhead.
The Region::unite() method becomes the most expensive piece, but we make it
much faster by testing Region::contains() with an early-out, avoiding a copy.
I see an improvement of this test case in chromium from 28fps to 37fps (32%
improvement) by using this CL along with the early-out in Region::unite().
More information about the webkit-reviews
mailing list