Closed Bug 1576356 Opened 5 years ago Closed 5 years ago

micro-optimize skip-ink rendering by using an autoarray for intercepts

Categories

(Core :: Layout: Text and Fonts, enhancement, P5)

enhancement

Tracking

()

RESOLVED FIXED
mozilla70
Tracking Status
firefox70 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

Details

Attachments

(1 file)

Short underlined fragments will rarely involve more than a handful of intercepts, so we shouldn't need to heap-allocate an array for them in nsCSSRendering::PaintDecorationLine. Longer runs can have as many as a couple of hundred, but that's still reasonable to stack-allocate.

I instrumented the code to see how many intercepts were being collected when scrolling through a long Wikipedia article, with styles modified to underline all body text, and to move the underline up so that it touches all characters. Even then, only occasionally did the number of intercepts go above the mid-200's. In real-world cases it will typically be much smaller. So let's use an autoarray here.

Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4db791aec1af
Use an AutoTArray to collect intercepts, to avoid heap allocation except in extreme cases. r=dholbert
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla70
Assignee: nobody → jfkthame
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: