Closed Bug 547591 Opened 14 years ago Closed 6 years ago

Rendering of -moz-border-*-colors is much slower than of border-color

Categories

(Core :: Web Painting, defect)

defect
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: mstange, Unassigned)

References

Details

(Keywords: perf)

Attachments

(1 file)

Attached file testcase
Load the attached testcase and click the button several times in quick succession. It will alternate between setting border-color and -moz-border-*-colors on the circles.

Observe how the measured times are different. On my machine the it's roughly
100ms vs 1000ms.
Keywords: perf
See nsCSSBorderRenderer::DrawBorders (in nsCSSRenderingBorders.cpp) and specifically the forceSeparateCorners boolean.  Your border-color testcase ends up with forceSeparateCorners false, which triggers a fast path.  Your border-*-colors testcase ends up with forceSeparateCorners true (see code comments for why; we could probably detect the special case of only one color and fast-path it if that would be useful) and takes a slower path involving clipping, etc.

About 30% of the slower-path time is under pushing groups and painting with alpha from nsCSSBorderRenderer::DrawBorders itself.  The rest is under the FillSolidBorder calls that DrawBorderSidesCompositeColors makes; I'm not sure why these are so much slower than the FillSolidBorder calls DrawBorderSides makes in the non-moz-border-colors case....
Blocks: 490055
OS: Mac OS X → All
It's not clear to me who should be working on this, but it feels sort of like this can be optimized from within the style system.
Component: Graphics → Style System (CSS)
QA Contact: thebes → style-system
This is code in nsCSSBorderRenderer.
Component: Style System (CSS) → Layout: View Rendering
QA Contact: style-system → layout.view-rendering
-moz-border-*-colors were removed in bug 1429723.
Status: NEW → RESOLVED
Closed: 6 years ago
Resolution: --- → INVALID
Component: Layout: View Rendering → Layout: Web Painting
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: