Re: Creating the desktop's menu bar takes 1 second



Am Dienstag, den 14.03.2006, 22:42 -0600 schrieb Federico Mena Quintero:
> Hi,
> 
> I've been taking some more profiles of nautilus startup, and creating
> the menu bar for the desktop window takes around 1 second at login time.
> Of course, the desktop window has no visible menu bar :)
> 
> Digging deeper, the culprit is this:
> 
> nautilus_window_initialize_menus {
>   ...
>   if (!have_burn_uri ()) {    <---- see below
>      set_visible (NAUTILUS_ACTION_GO_TO_BURN_CD, FALSE);
>   }
> 
> have_burn_uri() takes between 0.5 and 1.0 seconds, depending on whether
> we get preempted in the middle.  have_burn_uri() is expensive the first
> time, because it has to load libmapping.so in order to create a
> "burn:///" URI.  In addition, it has to spawn mapping-daemon due to the
> module's initialization function.  Given all the churn that happens
> during login, this can become really expensive, even with readahead
> files.
> 
> Ideally, the desktop window shouldn't get a menubar/statusbar created
> for it at all.  In the meantime, here's a simple patch to avoid calling
> have_burn_uri() for the desktop window.  Is this OK to commit?

Great stuff! :)

Couldn't we rather do this inside an idle handler, or when the menu is
brought up for the first time - or maybe check for the presence of
nautilus-cd-burner.desktop?, or make
_gnome_vfs_configuration_get_module_path public? I think it is common to
have multiple saved Nautilus windows open when restoring the last
session, and in that case your solution won't buy us much, right?

-- 
Christian Neumair <chris gnome-de org>




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