icontheme: Add profiler marks around icon theme loading
authorMatthias Clasen <mclasen@redhat.com>
Thu, 23 Jan 2020 02:31:08 +0000 (21:31 -0500)
committerMatthias Clasen <mclasen@redhat.com>
Thu, 23 Jan 2020 04:44:01 +0000 (23:44 -0500)
This is happening during the first frame.

gtk/gtkicontheme.c

index 25f010d6446dee71f1a41d8479977665d8a77a80..38a0bd276198a516add0bbddb79632dd0cd1d322 100644 (file)
@@ -1363,6 +1363,7 @@ ensure_valid_themes (GtkIconTheme *self)
 {
   GTimeVal tv;
   gboolean was_valid = self->themes_valid;
+  gint64 before = g_get_monotonic_time ();
 
   if (self->loading_themes)
     return;
@@ -1389,6 +1390,9 @@ ensure_valid_themes (GtkIconTheme *self)
         queue_theme_changed (self);
     }
 
+  if (gdk_profiler_is_running ())
+    gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "icon theme load", NULL);
+
   self->loading_themes = FALSE;
 }