[pango/speed-up-format-filtering: 6/8] Add timing spew for FcInit




commit 51537e2f414a7bab61b4542c79361c04271edc86
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Aug 19 14:10:57 2020 -0400

    Add timing spew for FcInit

 pango/pangofc-fontmap.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
---
diff --git a/pango/pangofc-fontmap.c b/pango/pangofc-fontmap.c
index e5cdaccf..eb43473e 100644
--- a/pango/pangofc-fontmap.c
+++ b/pango/pangofc-fontmap.c
@@ -1327,8 +1327,13 @@ init_in_thread (GTask        *task,
                 gpointer      task_data,
                 GCancellable *cancellable)
 {
+  gint64 before = g_get_monotonic_time ();
+
   FcInit ();
 
+  g_print ("FcInit took %.1f milliseconds\n",
+           (g_get_monotonic_time () - before)/((double)G_TIME_SPAN_MILLISECOND));
+
   g_mutex_lock (&fc_init_mutex);
   fc_initialized = TRUE;
   g_cond_signal (&fc_init_cond);
@@ -1338,10 +1343,15 @@ init_in_thread (GTask        *task,
 static void
 wait_for_fc_init (void)
 {
+  gint64 before = g_get_monotonic_time ();
+
   g_mutex_lock (&fc_init_mutex);
   while (!fc_initialized)
     g_cond_wait (&fc_init_cond, &fc_init_mutex);
   g_mutex_unlock (&fc_init_mutex);
+
+  g_print ("wait_for_fc_init took %.1f milliseconds\n",
+           (g_get_monotonic_time () - before)/((double)G_TIME_SPAN_MILLISECOND));
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]