mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 707959. Add word cache and font cache telemetry probes. r=roc
This commit is contained in:
parent
a34a09dbd7
commit
ad926a3cef
@ -70,6 +70,9 @@
|
|||||||
#include "prinit.h"
|
#include "prinit.h"
|
||||||
|
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
|
using namespace mozilla;
|
||||||
|
|
||||||
static PRLogModuleInfo *gFontLog = PR_NewLogModule("ft2fonts");
|
static PRLogModuleInfo *gFontLog = PR_NewLogModule("ft2fonts");
|
||||||
|
|
||||||
@ -614,6 +617,7 @@ gfxFT2Font::GetOrMakeFont(FT2FontEntry *aFontEntry, const gfxFontStyle *aStyle,
|
|||||||
bool aNeedsBold)
|
bool aNeedsBold)
|
||||||
{
|
{
|
||||||
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(aFontEntry, aStyle);
|
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(aFontEntry, aStyle);
|
||||||
|
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, font != nsnull);
|
||||||
if (!font) {
|
if (!font) {
|
||||||
cairo_scaled_font_t *scaledFont = aFontEntry->CreateScaledFont(aStyle);
|
cairo_scaled_font_t *scaledFont = aFontEntry->CreateScaledFont(aStyle);
|
||||||
font = new gfxFT2Font(scaledFont, aFontEntry, aStyle, aNeedsBold);
|
font = new gfxFT2Font(scaledFont, aFontEntry, aStyle, aNeedsBold);
|
||||||
|
@ -70,6 +70,7 @@
|
|||||||
#include "nsStyleConsts.h"
|
#include "nsStyleConsts.h"
|
||||||
#include "mozilla/Preferences.h"
|
#include "mozilla/Preferences.h"
|
||||||
#include "mozilla/Services.h"
|
#include "mozilla/Services.h"
|
||||||
|
#include "mozilla/Telemetry.h"
|
||||||
|
|
||||||
#include "cairo.h"
|
#include "cairo.h"
|
||||||
#include "gfxFontTest.h"
|
#include "gfxFontTest.h"
|
||||||
@ -204,6 +205,7 @@ gfxFontEntry::FindOrMakeFont(const gfxFontStyle *aStyle, bool aNeedsBold)
|
|||||||
// the font entry name is the psname, not the family name
|
// the font entry name is the psname, not the family name
|
||||||
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(this, aStyle);
|
nsRefPtr<gfxFont> font = gfxFontCache::GetCache()->Lookup(this, aStyle);
|
||||||
|
|
||||||
|
Telemetry::Accumulate(Telemetry::FONT_CACHE_HIT, font != nsnull);
|
||||||
if (!font) {
|
if (!font) {
|
||||||
gfxFont *newFont = CreateFontInstance(aStyle, aNeedsBold);
|
gfxFont *newFont = CreateFontInstance(aStyle, aNeedsBold);
|
||||||
if (!newFont)
|
if (!newFont)
|
||||||
@ -1920,8 +1922,13 @@ gfxFont::GetShapedWord(gfxContext *aContext,
|
|||||||
|
|
||||||
CacheHashEntry *entry = mWordCache.PutEntry(key);
|
CacheHashEntry *entry = mWordCache.PutEntry(key);
|
||||||
gfxShapedWord *sw = entry->mShapedWord;
|
gfxShapedWord *sw = entry->mShapedWord;
|
||||||
|
Telemetry::Accumulate(Telemetry::WORD_CACHE_LOOKUP_LEN, aLength);
|
||||||
|
Telemetry::Accumulate(Telemetry::WORD_CACHE_LOOKUP_SCRIPT, aRunScript);
|
||||||
|
|
||||||
if (sw) {
|
if (sw) {
|
||||||
sw->ResetAge();
|
sw->ResetAge();
|
||||||
|
Telemetry::Accumulate(Telemetry::WORD_CACHE_HIT_LEN, aLength);
|
||||||
|
Telemetry::Accumulate(Telemetry::WORD_CACHE_HIT_SCRIPT, aRunScript);
|
||||||
return sw;
|
return sw;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -128,6 +128,17 @@ HISTOGRAM(MAC_INITFONTLIST_TOTAL, 1, 30000, 10, EXPONENTIAL, "gfxMacPlatformFont
|
|||||||
HISTOGRAM(SYSTEM_FONT_FALLBACK, 1, 100000, 50, EXPONENTIAL, "System font fallback (us)")
|
HISTOGRAM(SYSTEM_FONT_FALLBACK, 1, 100000, 50, EXPONENTIAL, "System font fallback (us)")
|
||||||
HISTOGRAM(SYSTEM_FONT_FALLBACK_FIRST, 1, 40000, 20, EXPONENTIAL, "System font fallback, first call (ms)")
|
HISTOGRAM(SYSTEM_FONT_FALLBACK_FIRST, 1, 40000, 20, EXPONENTIAL, "System font fallback, first call (ms)")
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Word cache - one count for overall lookups, the other for the number of times a word is found
|
||||||
|
* Note: range and number of buckets must match
|
||||||
|
*/
|
||||||
|
HISTOGRAM(WORD_CACHE_LOOKUP_LEN, 1, 256, 30, EXPONENTIAL, "Word cache lookup (chars)")
|
||||||
|
HISTOGRAM(WORD_CACHE_HIT_LEN, 1, 256, 30, EXPONENTIAL, "Word cache hit (chars)")
|
||||||
|
HISTOGRAM(WORD_CACHE_LOOKUP_SCRIPT, 1, 110, 111, LINEAR, "Word cache lookup (script)")
|
||||||
|
HISTOGRAM(WORD_CACHE_HIT_SCRIPT, 1, 110, 111, LINEAR, "Word cache hit (script)")
|
||||||
|
|
||||||
|
HISTOGRAM_BOOLEAN(FONT_CACHE_HIT, "font cache hit")
|
||||||
|
|
||||||
HISTOGRAM_BOOLEAN(SHUTDOWN_OK, "Did the browser start after a successful shutdown")
|
HISTOGRAM_BOOLEAN(SHUTDOWN_OK, "Did the browser start after a successful shutdown")
|
||||||
|
|
||||||
HISTOGRAM(IMAGE_DECODE_LATENCY, 50, 5000000, 100, EXPONENTIAL, "Time spent decoding an image chunk (us)")
|
HISTOGRAM(IMAGE_DECODE_LATENCY, 50, 5000000, 100, EXPONENTIAL, "Time spent decoding an image chunk (us)")
|
||||||
|
Loading…
Reference in New Issue
Block a user