[gtk: 8/14] builder: Don't add profiler marks for short parses



commit e134eef505f4770f41cfc94c97e48be5c6e5b6f4
Author: Alexander Larsson <alexl redhat com>
Date:   Wed Feb 12 12:42:29 2020 +0100

    builder: Don't add profiler marks for short parses
    
    There are a lot of thes (since we're recursing), so don't spew the
    output with uninteresting ones.

 gtk/gtkbuilderparser.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)
---
diff --git a/gtk/gtkbuilderparser.c b/gtk/gtkbuilderparser.c
index 1aea5c2799..5440100b7f 100644
--- a/gtk/gtkbuilderparser.c
+++ b/gtk/gtkbuilderparser.c
@@ -1625,5 +1625,10 @@ _gtk_builder_parser_parse_buffer (GtkBuilder   *builder,
   /* restore the original domain */
   gtk_builder_set_translation_domain (builder, domain);
 
-  gdk_profiler_end_mark (before, "builder load", filename);
+  if (GDK_PROFILER_IS_RUNNING)
+    {
+      guint64 after = g_get_monotonic_time ();
+      if (after - before > 500)
+        gdk_profiler_add_mark (before, after - before, "builder load", filename);
+    }
 }


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