The default bug view has changed. See this FAQ.

add telemetry to determine effectiveness of font and shaped-word caching

RESOLVED FIXED in mozilla13

Status

()

Core
Layout: Text
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: jfkthame, Assigned: jtd)

Tracking

Trunk
mozilla13
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(2 attachments, 1 obsolete attachment)

(Reporter)

Description

5 years ago
We have caches with timed expiration for gfxFont instances and gfxTextRuns containing shaped glyph data (to be replaced by gfxShapedWord caches in bug 703100). We should add telemetry to help us determine whether the expiration times we're using are sensible. If they're too short, we may be frequently discarding things from the caches and then re-creating them almost immediately, which hurts performance; if they're too long, we may be using up memory for minimal perf benefit.

As a first step, we could report the cache hit rates; then we could change the timeouts on nightly builds for a few days, and see what effect this has.

Another metric that might be interesting would be to report the "age" of cache entries that are destined for eviction but then get reset because they're used again.
(Reporter)

Comment 1

5 years ago
Once bug 703100 lands, we can easily instrument this by hooking in to gfxFont::GetShapedWord.
Depends on: 703100
This is the sort of thing that Telemetry A/B infrastructure would be perfect for.  CC'ing Taras, who was looking for an excuse to use those bits.
(Assignee)

Comment 3

5 years ago
Created attachment 596916 [details] [diff] [review]
patch, add word cache telemetry probes to GetShapedWord

Add two probes, one for overall lookups the other just for hits.  Counts divided up based on length.
Assignee: nobody → jdaggett
Attachment #596916 - Flags: review?(jmuizelaar)
(Assignee)

Comment 4

5 years ago
Created attachment 597268 [details] [diff] [review]
patch, add word cache telemetry probes to GetShapedWord and font cache lookup

Revised to include lookup/hit per length and per script.  Also include font cache hits.
Attachment #596916 - Attachment is obsolete: true
Attachment #596916 - Flags: review?(jmuizelaar)
Attachment #597268 - Flags: review?(roc)
Attachment #597268 - Flags: review?(roc) → review+
(Assignee)

Comment 5

5 years ago
Pushed to mozilla-inbound
https://hg.mozilla.org/integration/mozilla-inbound/rev/f8ce0b7ebd80
(Reporter)

Comment 6

5 years ago
Created attachment 597316 [details] [diff] [review]
followup, move font cache telemetry into gfxFontCache::Lookup

The patch that just landed here doesn't instrument font cache lookups on Linux in gfxPangoFonts.cpp. (Or on OS/2, if we care...)

I think it'd make more sense to put the telemetry probe into gfxFontCache::Lookup itself, instead of duplicating it at each call site.
Attachment #597316 - Flags: review?(roc)
(Assignee)

Comment 7

5 years ago
Comment on attachment 597316 [details] [diff] [review]
followup, move font cache telemetry into gfxFontCache::Lookup

Sounds fine to me.  Wouldn't want to miss the all those font lookups on OS/2... ;)
Attachment #597316 - Flags: review?(roc) → review+
(Reporter)

Comment 8

5 years ago
Pushed followup:
https://hg.mozilla.org/integration/mozilla-inbound/rev/90213a7ffc24
Target Milestone: --- → mozilla13
https://hg.mozilla.org/mozilla-central/rev/f8ce0b7ebd80
https://hg.mozilla.org/mozilla-central/rev/90213a7ffc24
Status: NEW → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.