cache results of system font lookups on Windows

RESOLVED FIXED in Firefox 55

Status

()

defect
RESOLVED FIXED
2 years ago
2 years ago

People

(Reporter: dbaron, Assigned: dbaron)

Tracking

(Blocks 1 bug, {perf})

unspecified
mozilla55
x86
Windows 10
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(firefox55 fixed)

Details

(Whiteboard: [qf:p1])

Attachments

(2 attachments)

Profiling bug 1118086 on Windows shows that about 8% of the time in the big pause in the parent process to render a large select is time spent in mozilla::LookAndFeel::GetFont.  See the profile in https://perfht.ml/2qYJjqQ .

(Contrast with Linux, where time was spent in GetWidgetPadding / GetWidgetBorder; see bug 1367576.)

Caching the results of these repeated system font lookups should be a performance win, and should be pretty straightforward.
MozReview-Commit-ID: 8bwmXmBFZB4
Attachment #8875806 - Flags: review?(jmathies)
I haven't really tested that this fixes the performance problem observed
in a profile without the patch because the steps to use the Gecko
Profiler on local builds on Windows are rather complicated.

MozReview-Commit-ID: FmGFs2Cvquv
Attachment #8875807 - Flags: review?(jmathies)
Whiteboard: [qf] → [qf:p1]

Updated

2 years ago
Attachment #8875806 - Flags: review?(jmathies) → review+

Updated

2 years ago
Attachment #8875807 - Flags: review?(jmathies) → review+

Comment 6

2 years ago
bugherder
https://hg.mozilla.org/mozilla-central/rev/aa3557e8515c
https://hg.mozilla.org/mozilla-central/rev/70c026121670
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla55
I verified that it fixed what I expected by reprofiling in today's nightly.

In today's nightly, 7ms are spent inside of ComputeFontData: https://perfht.ml/2svcp5g

Whereas in the profile from comment 0, that was 172ms: https://perfht.ml/2suzJAk of which 159ms was spent inside nsRuleNode::ComputeSystemFont (compared to 0 in today's nightly).
You need to log in before you can comment on or make changes to this bug.