rate-limit the glyph cache dumping

Writing the file out every frame really isn't necessary.
Do it once per second.
This commit is contained in:
Matthias Clasen 2017-09-11 11:15:00 -04:00
parent 47cf17c70c
commit 781821bae4

View File

@ -642,10 +642,18 @@ dump_glyph_cache_stats (GlyphCache *cache)
{
GHashTableIter iter;
FontEntry *fe;
static gint64 time;
gint64 now;
if (!cache->fonts)
return;
now = g_get_monotonic_time ();
if (now - time < 1000000)
return;
time = now;
g_print ("Glyph cache:\n");
g_hash_table_iter_init (&iter, cache->fonts);
while (g_hash_table_iter_next (&iter, NULL, (gpointer *)&fe))