Closed Bug 244651 Opened 22 years ago Closed 22 years ago

nsTextFrame::Reflow does too much work

Categories

(Core :: Layout: Text and Fonts, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: bryner, Assigned: bryner)

References

Details

(Keywords: perf)

Attachments

(1 file)

TextStyle is a stack-based object that is used to avoid recomputing frequently-used style data for text frames during a given call to Reflow(), Paint(), etc. However, TextStyle doesn't discriminate between the Reflow and Paint cases, and as a result it spends time getting colors (from the style context and the LookAndFeel) when they aren't to be used for anything. I have a patch which makes a TextPaintStyle class (a subclass of TextStyle) that contains the extra color data. Local testing shows almost a 2% improvement in Tp from this (redwood tinderbox showed only about 1%; the average will probably be somewhere in between).
Attached patch patch — — Splinter Review
This also removes some overzealous initialization and nulling out of members in the TextStyle object. Hopefully there's no subtle reason I missed that those pointers were nulled out in the dtor.
Comment on attachment 149282 [details] [diff] [review] patch One more thing... I simply removed mVisibility; it's not used for anything.
Attachment #149282 - Flags: superreview?(bzbarsky)
Attachment #149282 - Flags: review?(bzbarsky)
Comment on attachment 149282 [details] [diff] [review] patch Looks reasonable. r+sr=bzbarsky
Attachment #149282 - Flags: superreview?(bzbarsky)
Attachment #149282 - Flags: superreview+
Attachment #149282 - Flags: review?(bzbarsky)
Attachment #149282 - Flags: review+
checked in.
Status: NEW → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
*** Bug 77939 has been marked as a duplicate of this bug. ***
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: