Re: Performance data for nautilus



On Wed, 16 Oct 2002, Anand Subramanian wrote:

> Hello everyone.
> 
> On a sequel to the gedit performance data, we are attaching the
> performance report for nautilus. The forte and quantify tools were used
> to collect performance data. The attached html report details the
> nautilus test scenarios, a brief  analysis and links to the performance
> data. Please do get back to us in case you require any additional
> information.

Very interesting. As usual it shows up GObject at its worst. I fixed a 
leak in nautilus and a couple of places that were excessively typesafe, 
but a lot of this is hard to fix.

I've attached the interesting data for gtype.c. One thing that strikes me 
is:
  * *********************************************************
  *  Function:                      g_type_check_instance_is_a
  *  Called:                          1106240 times
  *  Function time:                 121654830 cycles ( 2.25% of .root.)
  *  Function+descendants time:     344618647 cycles ( 6.37% of .root.)
  *  Distribution to Callers:
  *    203845 times (18.63% of f+d time) g_object_ref
  *    210290 times (19.22% of f+d time) g_object_unref
  * *********************************************************

It seems a full 2.4% of the nautilus execution time is spent making sure 
that what you pass to g_object_ref/unref() is actually GObjects.
I'm not sure it's really worth that. Maybe we should change G_IS_OBJECT to 
g_type_fundamental (((GTypeInstance *)(instance))->g_class->g_type) == 
G_TYPE_OBJECT. Or maybe we should just totally dump the typecheck?

Other interesting data:
  * *********************************************************
  *  Function:                      g_type_check_instance_is_a
  *  Called:                          1106240 times
  *  Function time:                 121654830 cycles ( 2.25% of .root.)
  *  Function+descendants time:     344618647 cycles ( 6.37% of .root.)
  *  Distribution to Callers:
  *     38801 times ( 3.47% of f+d time) gtk_widget_unref
  *     38797 times ( 3.47% of f+d time) gtk_widget_ref
  * *********************************************************

Since these are deprecated and just chain up to g_object_ref/unref i think 
we shoudl remove the 
  g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL);

The only thing these protect against is passing valid objects that are not 
widgets to gtk_widget_ref/unref, something i consider unlikely.

  * *********************************************************
  *  Function:                      g_type_check_instance_cast
  *  Called:                           915215 times
  *  Function time:                 120808380 cycles ( 2.23% of .root.)
  *  Function+descendants time:     303024736 cycles ( 5.61% of .root.)
  *  Distribution to Callers:
  *     20905 times ( 2.28% of f+d time) gdk_event_translate
  *     38552 times ( 4.20% of f+d time) pango_fontset_simple_get_font
  *     93995 times (10.24% of f+d time) gtk_widget_event_internal
  *     62804 times ( 6.98% of f+d time) gtk_signal_emit
  * *********************************************************

These are small fish compared to the ref/unrefs, but they still stick out 
a bit to much.

-- 
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
 Alexander Larsson                                            Red Hat, Inc 
                   alexl redhat com    alla lysator liu se 
He's an unconventional overambitious master criminal gone bad. She's a cynical 
nymphomaniac barmaid married to the Mob. They fight crime! 

Run 1

              * *********************************************************
              *  Function:                      lookup_type_node_I
              *  Called:                          7504454 times
              *  Function time:                 265918521 cycles ( 4.92% of .root.)
              *  Function+descendants time:     265918521 cycles ( 4.92% of .root.)
              *  Distribution to Callers:
              *   1830430 times (23.77% of f+d time) g_type_check_instance_cast
              *    747494 times (10.20% of f+d time) g_type_is_a
              *   1160343 times (15.78% of f+d time) type_check_is_value_type_U
              *   1136897 times (15.32% of f+d time) g_type_value_table_peek
              *   2212220 times (29.50% of f+d time) g_type_check_instance_is_a
              * *********************************************************
              * *********************************************************
              *  Function:                      type_node_check_conformities_UorL
              *  Called:                          2443819 times
              *  Function time:                 198645181 cycles ( 3.67% of .root.)
              *  Function+descendants time:     198752566 cycles ( 3.68% of .root.)
              *  Distribution to Callers:
              *         6 times ( 0.00% of f+d time) type_node_is_a_L
              *   2443813 times (100.00% of f+d time) type_node_conforms_to_U
              * *********************************************************
              * *********************************************************
              *  Function:                      type_node_conforms_to_U
              *  Called:                          2443813 times
              *  Function time:                 119746837 cycles ( 2.21% of .root.)
              *  Function+descendants time:     318498643 cycles ( 5.89% of .root.)
              *  Distribution to Callers:
              *       576 times ( 0.02% of f+d time) g_type_check_class_is_a
              *     48165 times ( 1.97% of f+d time) g_type_check_class_cast
              *    915215 times (37.37% of f+d time) g_type_check_instance_cast
              *    373747 times (15.27% of f+d time) g_type_is_a
              *   1106110 times (45.37% of f+d time) g_type_check_instance_is_a
              * *********************************************************
              * *********************************************************
              *  Function:                      g_type_is_a
              *  Called:                           373747 times
              *  Function time:                  31394076 cycles ( 0.58% of .root.)
              *  Function+descendants time:     107161740 cycles ( 1.98% of .root.)
              *  Distribution to Callers:
              *    123118 times (33.90% of f+d time) g_type_check_value_holds
              *     78467 times (20.70% of f+d time) g_signal_emit_valist
              *    167478 times (44.15% of f+d time) g_value_type_compatible
              * *********************************************************
              * *********************************************************
              *  Function:                      g_type_check_instance_is_a
              *  Called:                          1106240 times
              *  Function time:                 121654830 cycles ( 2.25% of .root.)
              *  Function+descendants time:     344618647 cycles ( 6.37% of .root.)
              *  Distribution to Callers:
	      *     12960 times ( 1.16% of f+d time) nautilus_icon_canvas_item_hit_test_rectangle
              *     18722 times ( 1.67% of f+d time) nautilus_file_compare_for_sort_internal
              *     28123 times ( 2.51% of f+d time) pango_ft2_font_get_cache_glyph_data
              *     17219 times ( 1.54% of f+d time) gtk_widget_event
              *     38801 times ( 3.47% of f+d time) gtk_widget_unref
              *     38797 times ( 3.47% of f+d time) gtk_widget_ref
              *     13792 times ( 1.26% of f+d time) g_object_get_qdata
              *     62804 times ( 5.61% of f+d time) gtk_signal_emit
              *    203845 times (18.63% of f+d time) g_object_ref
              *    210290 times (19.22% of f+d time) g_object_unref
              * *********************************************************
              * *********************************************************
              *  Function:                      g_type_check_instance_cast
              *  Called:                           915215 times
              *  Function time:                 120808380 cycles ( 2.23% of .root.)
              *  Function+descendants time:     303024736 cycles ( 5.61% of .root.)
              *  Distribution to Callers:
              *     14282 times ( 1.56% of f+d time) gnome_canvas_group_draw
              *     27567 times ( 3.00% of f+d time) fm_icon_container_compare_icons
              *      9361 times ( 1.02% of f+d time) fm_icon_view_compare_files
              *      9465 times ( 1.03% of f+d time) get_icon_view
              *     20905 times ( 2.28% of f+d time) gdk_event_translate
              *     38552 times ( 4.20% of f+d time) pango_fontset_simple_get_font
              *      8993 times ( 1.00% of f+d time) get_size_groups
              *     10743 times ( 1.17% of f+d time) gdk_x11_draw_segments
              *      9502 times ( 1.06% of f+d time) gtk_object_get_data_by_id
              *     17207 times ( 1.87% of f+d time) gtk_widget_event
              *     93995 times (10.24% of f+d time) gtk_widget_event_internal
              *     12516 times ( 1.38% of f+d time) gtk_grab_notify_foreach
              *     62804 times ( 6.98% of f+d time) gtk_signal_emit
              * *********************************************************
	      
Run 2:
              * *********************************************************
              *  Function:                      lookup_type_node_I
              *  Called:                          4103986 times
              *  Function time:                 144444113 cycles ( 4.27% of .root.)
              *  Function+descendants time:     144444113 cycles ( 4.27% of .root.)
              *  Distribution to Callers:
              *    317540 times ( 7.87% of f+d time) g_type_is_a
              *    465900 times (11.47% of f+d time) g_type_value_table_peek
              *    473279 times (11.70% of f+d time) type_check_is_value_type_U
              *   1182076 times (28.27% of f+d time) g_type_check_instance_cast
              *   1349690 times (33.09% of f+d time) g_type_check_instance_is_a
              * *********************************************************
              * *********************************************************
              *  Function:                      type_node_check_conformities_UorL
              *  Called:                          1474848 times
              *  Function time:                 119955353 cycles ( 3.54% of .root.)
              *  Function+descendants time:     120068916 cycles ( 3.55% of .root.)
              *  Distribution to Callers:
              *         6 times ( 0.00% of f+d time) type_node_is_a_L
              *   1474842 times (100.00% of f+d time) type_node_conforms_to_U
              * *********************************************************
              * *********************************************************
              *  Function:                      type_node_conforms_to_U
              *  Called:                          1474842 times
              *  Function time:                  72267258 cycles ( 2.13% of .root.)
              *  Function+descendants time:     192335414 cycles ( 5.68% of .root.)
              *  Distribution to Callers:
              *       558 times ( 0.04% of f+d time) g_type_check_class_is_a
              *     49631 times ( 3.35% of f+d time) g_type_check_class_cast
              *    591038 times (39.97% of f+d time) g_type_check_instance_cast
              *    158770 times (10.76% of f+d time) g_type_is_a
              *    674845 times (45.88% of f+d time) g_type_check_instance_is_a
              * *********************************************************
              * *********************************************************
              *  Function:                      g_type_is_a
              *  Called:                           158770 times
              *  Function time:                  13335820 cycles ( 0.39% of .root.)
              *  Function+descendants time:      45398381 cycles ( 1.34% of .root.)
              *  Distribution to Callers:
              *     35571 times (23.04% of f+d time) g_type_check_value_holds
              *     34578 times (21.61% of f+d time) g_signal_emit_valist
              *     83139 times (51.85% of f+d time) g_value_type_compatible
              * *********************************************************
              * *********************************************************
              *  Function:                      g_type_check_instance_is_a
              *  Called:                           675085 times
              *  Function time:                  74226606 cycles ( 2.19% of .root.)
              *  Function+descendants time:     210270960 cycles ( 6.21% of .root.)
              *  Distribution to Callers:
              *      8016 times ( 1.17% of f+d time) gdk_draw_points
              *      8389 times ( 1.23% of f+d time) fm_icon_view_compare_files
              *     16778 times ( 2.46% of f+d time) nautilus_file_compare_for_sort_internal
              *     11546 times ( 1.69% of f+d time) pango_ft2_font_get_cache_glyph_data
              *      8390 times ( 1.23% of f+d time) get_icon_view
              *      7352 times ( 1.10% of f+d time) g_param_spec_unref
              *      8061 times ( 1.21% of f+d time) g_param_spec_ref
              *      9778 times ( 1.43% of f+d time) gtk_object_get_data_by_id
              *     10526 times ( 1.54% of f+d time) gtk_widget_unref
              *     10519 times ( 1.54% of f+d time) gtk_widget_ref
              *     12404 times ( 1.86% of f+d time) g_object_get_qdata
              *     19016 times ( 2.79% of f+d time) gtk_signal_emit
              *    106759 times (15.99% of f+d time) g_object_ref
              *    111014 times (16.63% of f+d time) g_object_unref
              * *********************************************************
              * *********************************************************
              *  Function:                      g_type_check_instance_cast
              *  Called:                           591038 times
              *  Function time:                  78017016 cycles ( 2.30% of .root.)
              *  Function+descendants time:     195727938 cycles ( 5.78% of .root.)
              *  Distribution to Callers:
              *      6012 times ( 1.01% of f+d time) gdk_x11_draw_points
              *      5875 times ( 0.99% of f+d time) gnome_canvas_group_draw
              *     22770 times ( 3.84% of f+d time) fm_icon_container_compare_icons
              *      8389 times ( 1.41% of f+d time) fm_icon_view_compare_files
              *      8390 times ( 1.41% of f+d time) get_icon_view
              *     12434 times ( 2.10% of f+d time) gdk_event_translate
              *      9879 times ( 1.67% of f+d time) gtk_widget_propagate_hierarchy_changed_recurse
              *      9887 times ( 1.68% of f+d time) gtk_widget_unparent
              *     18322 times ( 3.09% of f+d time) pango_fontset_simple_get_font
              *      9450 times ( 1.59% of f+d time) real_queue_resize
              *      6975 times ( 1.18% of f+d time) _gtk_container_queue_resize
              *      9250 times ( 1.59% of f+d time) get_size_groups
              *      9894 times ( 1.69% of f+d time) gtk_grab_notify_foreach
              *      8780 times ( 1.48% of f+d time) gtk_widget_propagate_state
              *     12912 times ( 2.18% of f+d time) gdk_x11_gc_set_values
              *      9466 times ( 1.60% of f+d time) _gdk_x11_gc_flush
              *     19016 times ( 3.27% of f+d time) gtk_signal_emit
              *      8608 times ( 1.45% of f+d time) gtk_object_dispose
              * *********************************************************



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