diff options
author | Alexander Larsson <alexl@redhat.com> | 2020-02-12 12:43:27 +0100 |
---|---|---|
committer | Alexander Larsson <alexl@redhat.com> | 2020-02-12 12:43:27 +0100 |
commit | b4b00e28871ffb596eec94617f8699ed90ece2a2 (patch) | |
tree | 0a1b2b7a201fb9055013f232ede0f52e7538cd92 /gtk/gtkicontheme.c | |
parent | e134eef505f4770f41cfc94c97e48be5c6e5b6f4 (diff) | |
download | gtk+-b4b00e28871ffb596eec94617f8699ed90ece2a2.tar.gz |
icon theme: Don't add profiler marks for short async icon loads
We do a bunch of preloads, and most of these are not really interesting
anyway.
Diffstat (limited to 'gtk/gtkicontheme.c')
-rw-r--r-- | gtk/gtkicontheme.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 3151d3b316..5c1f2dc22c 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -3606,8 +3606,13 @@ icon_ensure_texture__locked (GtkIconPaintable *icon, g_assert (icon->texture != NULL); if (GDK_PROFILER_IS_RUNNING) - gdk_profiler_end_markf (before, in_thread ? "icon load (thread)" : "icon load" , - "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale); + { + guint64 end = g_get_monotonic_time (); + /* Don't report quick (< 0.5 msec) parses */ + if (end - before > 500 || !in_thread) + gdk_profiler_add_markf (before, (end - before), in_thread ? "icon load (thread)" : "icon load" , + "%s size %d@%d", icon->filename, icon->desired_size, icon->desired_scale); + } } static GdkTexture * |