Re: Profiling GTK within an application



Stefan Kost wrote:
I figured out that Sun's dtrace tool allows me to basically script a
sampling profiler just as you describe.  Very cool program.  My program
is spending more than 50% of its userland time executing code in glib,
and a vast majority of that is split evenly between two functions:
g_slist_find() and g_slist_remove_all().

I'm going to have to do some more work to figure out the context in
which these functions are being invoked, but I'm making progress!  :)

If this is infact your problem, then I wonder how the gtk version can cause a
difference here. I don't belive there is a huge increase of such calls in newer
gtk-versions. Would be good it you can get backtraces.

I'm changing the colors of a lot of buttons very quickly in my app.
This seems to account for many of these calls.  Maybe the overhead of
acquiring the g_dataset_global (glib/gdataset.C) lock is now more?  It
looks like we have threading enabled in both glib version (2.6 and
2.14.)  I see that in 2.6 our configuration had G_THREADS_IMPL_SOLARIS
defined versus G_THREADS_IMPL_POSIX in 2.12, the former no longer being
available in glib.

Here's a trace:

#0  0xfe286a2e in g_slist_remove_all ()
   from /opt/app/nonc++/glib-2.14/lib/libglib-2.0.so.0
#1  0xfe974a90 in gtk_rc_style_finalize ()
   from /opt/app/nonc++/gtk+-2.12/lib/libgtk-x11-2.0.so.0
#2  0xfe35d851 in g_object_unref ()
   from /opt/app/nonc++/glib-2.14/lib/libgobject-2.0.so.0
#3  0xfe974ca9 in gtk_rc_style_unref ()
   from /opt/app/nonc++/gtk+-2.12/lib/libgtk-x11-2.0.so.0
#4  0xfe25b739 in g_datalist_id_set_data_full ()
   from /opt/app/nonc++/glib-2.14/lib/libglib-2.0.so.0
#5  0xfe35f66f in g_object_set_qdata_full ()
   from /opt/app/nonc++/glib-2.14/lib/libgobject-2.0.so.0
#6  0xfea3d628 in gtk_widget_modify_style ()
   from /opt/app/nonc++/gtk+-2.12/lib/libgtk-x11-2.0.so.0
#7  0xfea3d901 in gtk_widget_modify_color_component ()
   from /opt/app/nonc++/gtk+-2.12/lib/libgtk-x11-2.0.so.0
#8  0xfee1ea3c in Gtk::Widget::modify_fg ()
   from /opt/app/g++lib6/gtkmm-2.12/lib/libgtkmm-2.4.so.1




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