Closed Bug 707959 Opened 13 years ago Closed 12 years ago

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

Categories

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

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla13

People

(Reporter: jfkthame, Assigned: jtd)

References

Details

Attachments

(2 files, 1 obsolete file)

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.
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.
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)
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)
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)
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... ;)
Pushed followup:
https://hg.mozilla.org/integration/mozilla-inbound/rev/90213a7ffc24
Target Milestone: --- → mozilla13
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: