Optimize the performance of RenderLayer::calculateRects
Created attachment 440356 [details] Patch
Here are the percentage of RenderLayer::calculateRects * Original: 24.1%, 25.7%, 25% * This patch: 14.9%, 14.9%, 16.0%
Created attachment 440357 [details] screenshot-of-optimized-collectRects
Created attachment 440358 [details] screenshot-of-original-collectRects
Comment on attachment 440356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440356&action=review > Source/WebCore/rendering/RenderLayer.cpp:4630 > + bool backgroundRectNotNeedRepaint = !hasBackgroundClipRect > + && m_repaintRectsValid > + && !m_repaintRects.clippedOverflowRect.intersects(backgroundRect.rect()) > + && !m_repaintRects.outlineBoundsRect.intersects(backgroundRect.rect()); This seems wrong. Clip rect computation should be independent of cached repaint rects, and this code is not about needing repaint.
Comment on attachment 440356 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440356&action=review >> Source/WebCore/rendering/RenderLayer.cpp:4630 >> + && !m_repaintRects.outlineBoundsRect.intersects(backgroundRect.rect()); > > This seems wrong. Clip rect computation should be independent of cached repaint rects, and this code is not about needing repaint. Hmm, it seems if backgroundRect or foregroundRect doesn't intersect with repaint rests, then they can't intersect with these rects: overflowClipRect, clipRect, or borderBoxRect. The repaint rests always cover these rests, no?
<rdar://problem/84098726>