[gtk] Add profiler marks around css selector tree building



commit f5865b125ef6ed8a0ef9e207578b0f6a6c3053fa
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Jan 23 10:29:22 2020 -0500

    Add profiler marks around css selector tree building
    
    This is a big part of theme loading, and worth
    showing in traces.

 gtk/gtkcssprovider.c | 4 ++++
 1 file changed, 4 insertions(+)
---
diff --git a/gtk/gtkcssprovider.c b/gtk/gtkcssprovider.c
index f97776d801..6c25afae67 100644
--- a/gtk/gtkcssprovider.c
+++ b/gtk/gtkcssprovider.c
@@ -967,6 +967,7 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
   GtkCssProviderPrivate *priv = gtk_css_provider_get_instance_private (css_provider);
   GtkCssSelectorTreeBuilder *builder;
   guint i;
+  gint64 before = g_get_monotonic_time ();
 
   g_array_sort (priv->rulesets, gtk_css_provider_compare_rule);
 
@@ -997,6 +998,9 @@ gtk_css_provider_postprocess (GtkCssProvider *css_provider)
       ruleset->selector = NULL;
     }
 #endif
+
+  if (gdk_profiler_is_running ())
+    gdk_profiler_add_mark (before * 1000, (g_get_monotonic_time () - before) * 1000, "create selector tree", 
NULL);
 }
 
 static void


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