Re: accessing stock icons during startup




Matthias Clasen wrote On 11/04/05 17:23,:

>On Fri, 2005-11-04 at 17:12 +0000, Padraig O'Briain wrote:
>  
>
>>While looking at gnome-panel startup in GNOME 2.12 on Solaris I noticed
>>that about 110 ms was being used in gtk_style_init() when created the
>>first widget, the panel toplevel. This may not sound like a lot but I
>>have noticed that the same thing seems to occur in the 11 processes
>>listed below which start during GNOME startup:
>>
>>gnome-settings-daemon
>>gnome-session
>>metacity
>>gnome-panel
>>nautilus
>>wnck-applet
>>gnome-volcheck
>>clock-applet
>>notification-area-applet
>>gnome-netstatus-applet
>>mixer_applet2
>>
>>A lot of this time is spent accessing or attempting to access stock
>>icons. Snippet of Solaris truss file below. You should see similar on
>>linux by running strace on the startup of a GNOME program.
>>
>>475/1:        22.6064
>>access("/usr/share/icons/blueprint/stock/16x16/stock_apply_20.png",
>>F_OK) Err#2 ENOENT
>>475/1:        22.6066
>>access("/usr/share/icons/blueprint/stock/20x20/stock_apply_20.png",
>>F_OK) = 0
>>475/1:        22.6068
>>access("/usr/share/icons/blueprint/stock/16x16/stock_cancel_20.png",
>>F_OK) Err#2 ENOENT
>>475/1:        22.6069
>>access("/usr/share/icons/blueprint/stock/20x20/stock_cancel_20.png",
>>F_OK) = 0
>>475/1:        22.6071
>>access("/usr/share/icons/blueprint/stock/16x16/stock_cdrom_16.png",
>>F_OK) = 0
>>475/1:        22.6074
>>access("/usr/share/icons/blueprint/stock/16x16/stock_cdrom_24.png",
>>F_OK) Err#2 ENOENT
>>475/1:        22.6075
>>access("/usr/share/icons/blueprint/stock/20x20/stock_cdrom_24.png",
>>F_OK) Err#2 ENOENT
>>
>>
>>The stack trace for the access call gives some idea of what code is
>>being executed:
>>
>>        libc.so.1`access+0x4
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_check_pixmap_dir+0x18
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_find_pixmap_in_path+0x34
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_icon_source+0x94
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_stock+0xb4
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_style+0x568
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_any+0x130
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_context_parse_one_file+0x148
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_context_parse_file+0xfc
>>        libgtk-x11-2.0.so.0.800.6`parse_include_file+0xc0
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_statement+0x8c
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_any+0x130
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_context_parse_one_file+0x148
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_context_parse_file+0xfc
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_parse_named+0x124
>>        libgtk-x11-2.0.so.0.800.6`gtk_rc_reparse_all_for_settings+0x228
>>        libgtk-x11-2.0.so.0.800.6`gtk_settings_get_for_screen+0xcc
>>        libgtk-x11-2.0.so.0.800.6`gtk_style_init+0x14
>>        libgobject-2.0.so.0.800.3`g_type_create_instance+0x268
>>        libgobject-2.0.so.0.800.3`g_object_constructor+0x18
>>
>>Lorenzo's document,http://www.gnome.org/~lcolitti/gnome-startup/analysis/,
>>refers to an icon cache.
>>
>>Is the icon cache in GNOME 2.12 and is it supposed to address this problem?
>>
>>Padraig
>>    
>>
>
>The icon cache is in 2.12, but what you are seeing here is not covered
>by it. This looks like gtk theme which reassigns a lot of stock icons in
>its gtkrc file, like this: 
>
>  stock["gnome-stock-about"] = {{ "stock_about.png" }}
>  stock["gnome-stock-volume"] = {{ "stock_volume.png" }}
>  stock["gnome-stock-mic"] = {{ "stock_mic.png" }}
>
>Can you show us the gtkrc file thats being used here ?
>  
>
It looks like the file is /usr/share/themes/blueprint/gtk-2.0, which I
have attached.

Do you have any recommendations on changes to this file which would
speed things up?

Padraig

>Matthias
>
>  
>
pixmap_path "/usr/share/icons/blueprint/stock/16x16:/usr/share/icons/blueprint/stock/20x20:/usr/share/icons/blueprint/stock/24x24:/usr/share/icons/blueprint/stock/48x48:/usr/share/icons/blueprint/stock/32x32:/usr/share/icons/blueprint/48x48/apps"
style "icon-style"
{
  stock["gtk-apply"] =		  {{ "stock_apply_20.png", *, *, *}}
  
  stock["gtk-cancel"] =		  {{ "stock_cancel_20.png", *, *, * }}
  
  stock["gtk-cdrom"] =		  {{ "stock_cdrom_16.png", *, *, "gtk-menu"},
				  {  "stock_cdrom_24.png", *, *, *}}
			
  stock["gtk-close"] =		  {{ "stock_close_20.png", *, *, "gtk-button"},
				   { "stock_close_24.png", *, *, *}}

  stock["gtk-copy"] =		  {{ "stock_copy_16.png", *, *, "gtk-menu"},
				  { "stock_copy_24.png", *, *, *}}
		       
  stock["gtk-delete"] =		  {{ "stock_trash_16.png", *, *, "gtk-menu"},
				  { "stock_trash_24.png", *, *, *}}
			 
  stock["gtk-dialog-authentication"] = {{ "stock_dialog_authentication_48.png", *, *, *}}
  stock["gtk-dialog-error"] =	  {{ "stock_dialog_error_48.png", *, *, *}}
  stock["gtk-dialog-info"] =	  {{ "stock_dialog_info_48.png", *, *, *}}
  stock["gtk-dialog-question"] =  {{ "stock_dialog_question_48.png", *, *, *}}
  stock["gtk-dialog-warning"] =	  {{ "stock_dialog_warning_48.png", *, *, *}}
  stock["gtk-dnd-multiple"] =	  {{ "stock_dnd_multiple_32.png", *, *, *}}
  stock["gtk-dnd"] =		  {{ "stock_dnd_32.png", *, *, *}}
  
  stock["gtk-execute"] =	  {{ "stock_exec_16.png", *, *, "gtk-menu"},
				   { "stock_exec_24.png", *, *, *}}
			  
  stock["gtk-find"] =		  {{ "stock_search_16.png", *, *, "gtk-menu"},
				   { "stock_search_24.png", *, *, *}}

  stock["gtk-floppy"] =		  {{ "stock_save_16.png", *, *, "gtk-menu"},
				   { "stock_save_24.png", *, *, *}}
			 
  stock["gtk-go-back"] =	  {{ "stock_left_arrow_16.png", *, *, "gtk-menu"},
				   { "stock_left_arrow_24.png", *, *, *}}
			  
  stock["gtk-go-down"] =	  {{ "stock_down_arrow_16.png", *, *, "gtk-menu"},
				   { "stock_down_arrow_24.png", *, *, *}}
			  
  stock["gtk-go-forward"] =	  {{ "stock_right_arrow_16.png", *, *, "gtk-menu"},
				   { "stock_right_arrow_24.png", *, *, *}}
			     
  stock["gtk-goto-bottom"] =	  {{ "stock_bottom_16.png", *, *, "gtk-menu"},
				   { "stock_bottom_24.png", *, *, *}}
			      
  stock["gtk-goto-first"] =	  {{ "stock_first_16.png", *, *, "gtk-menu"},
				   { "stock_first_24.png", *, *, *}}
			     
  stock["gtk-goto-last"] =	  {{ "stock_last_16.png", *, *, "gtk-menu"},
				   { "stock_last_24.png", *, *, *}}
			    
  stock["gtk-goto-top"] =	  {{ "stock_top_16.png", *, *, "gtk-menu"},
				   { "stock_top_24.png", *, *, *}}
  
  stock["gtk-go-up"] =		  {{ "stock_up_arrow_16.png", *, *, "gtk-menu"},
				   { "stock_up_arrow_24.png", *, *, *}}

  stock["gtk-help"] =		  {{ "stock_help_16.png", *, *, "gtk-menu"},
				   { "stock_help_24.png", *, *, *}}
  
  stock["gtk-home"] =		  {{ "stock_home_16.png", *, *, "gtk-menu"},
				   { "stock_home_24.png", *, *, *}}
  
  stock["gtk-jump-to"] =	  {{ "stock_jump_to_rtl_16.png", RTL, *, "gtk-menu"},
				   { "stock_jump_to_16.png", *, *, "gtk-menu"},
				   { "stock_jump_to_rtl_24.png", RTL, *, *},
				   { "stock_jump_to_24.png", *, *, *}}
  
  stock["gtk-missing-image"] =	  {{ "stock_broken_image_16.png", *, *, "gtk-menu"},
				   { "stock_broken_image_24.png", *, *, *}}
  
  stock["gtk-network"] =	  {{ "stock_network_16.png", *, *, "gtk-menu"},
				   { "stock_network_24.png", *, *, *}}
  
  stock["gtk-new"] =		  {{ "stock_new_16.png", *, *, "gtk-menu"},
				   { "stock_new_24.png", *, *, *}}
  
  stock["gtk-no"] =		  {{ "stock_no_20.png", *, *, * }}
  
  stock["gtk-ok"] =		  {{ "stock_ok_20.png", *, *, * }}
  
  stock["gtk-open"] =		  {{ "stock_open_16.png", *, *, "gtk-menu"},
				   { "stock_open_24.png", *, *, *}}
  
  stock["gtk-preferences"] =	  {{ "stock_preferences_16.png", *, *, "gtk-menu"},
				   { "stock_preferences_24.png", *, *, *}}
  
  stock["gtk-print"] =		  {{ "stock_print_16.png", *, *, "gtk-menu"},
				   { "stock_print_24.png", *, *, *}}

  stock["gtk-print-preview"] =	  {{ "stock_print_preview_16.png", *, *, "gtk-menu"},
				   { "stock_print_preview_24.png", *, *, *}}

  stock["gtk-quit"] =		  {{ "stock_exit_16.png", *, *, "gtk-menu"},
				   { "stock_exit_24.png", *, *, *}}
		       
  stock["gtk-redo"] =		  {{ "stock_redo_rtl_16.png", RTL, *, "gtk-menu"},
				   { "stock_redo_16.png", *, *, "gtk-menu"},
				   { "stock_redo_rtl_24.png", RTL, *, *},
				   { "stock_redo_24.png", *, *, *}}

  stock["gtk-refresh"] =	  {{ "stock_refresh_16.png", *, *, "gtk-menu"},
				   { "stock_refresh_24.png", *, *, *}}

  stock["gtk-revert-to-saved"] =  {{ "stock_revert_rtl_16.png", RTL, *, "gtk-menu"},
				   { "stock_revert_16.png", *, *, "gtk-menu"},
				   { "stock_revert_rtl_24.png", RTL, *, *},
				   { "stock_revert_24.png", *, *, *}}

  stock["gtk-save-as"] =	  {{ "stock_save_as_16.png", *, *, "gtk-menu"},
				   { "stock_save_as_24.png", *, *, *}}

  stock["gtk-save"] =		  {{ "stock_save_16.png", *, *, "gtk-menu"},
				   { "stock_save_24.png", *, *, *}}

  stock["gtk-spell-check"] =	  {{ "stock_spellcheck_16.png", *, *, "gtk-menu"},
				   { "stock_spellcheck_24.png", *, *, *}}

  stock["gtk-stop"] =		  {{ "stock_stop_16.png", *, *, "gtk-menu"},
				   { "stock_stop_24.png", *, *, *}}

  stock["gtk-undelete"] =	  {{ "stock_undelete_rtl_16.png", RTL, *, "gtk-menu"},
				   { "stock_undelete_16.png", *, *, "gtk-menu"},
				   { "stock_undelete_rtl_24.png", RTL, *, *},
				   { "stock_undelete_24.png", *, *, *}}

  stock["gtk-undo"] =		  {{ "stock_undo_rtl_16.png", RTL, *, "gtk-menu"},
				   { "stock_undo_16.png", *, *, "gtk-menu"},
				   { "stock_undo_rtl_24.png", RTL, *, *},
				   { "stock_undo_24.png", *, *, *}}

  stock["gtk-yes"] =		  {{ "stock_yes_20.png", *, *, * }}
  
  stock["panel-my-computer"] =	  {{ "my-computer.png", *, *, * }}

}
class "GtkWidget" style "icon-style"


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