Commit d8c158e7 authored by Richard Hughes's avatar Richard Hughes
Browse files

Create a reference to a GnomePnpIds object to speed up loading

During loading, the singleton GnomePnpIds is created and destroyed 3 times
during startup. This means that the pnp.ids is loaded from disk each time and
re-parsed.

Whilst loading it from disk subsequent times is fast, parsing is not.
By keeping a reference at daemon startup ensures it's only loaded and unloaded
once per daemon startup-shutdown.

This speeds up startup of gnome-settings-daemon by about 400ms.
parent 2b348db7
......@@ -30,6 +30,9 @@
#include <glib-object.h>
#include <gio/gio.h>
#define GNOME_DESKTOP_USE_UNSTABLE_API
#include <libgnome-desktop/gnome-pnp-ids.h>
#include "gnome-settings-plugin-info.h"
#include "gnome-settings-manager.h"
#include "gnome-settings-profile.h"
......@@ -64,6 +67,7 @@ struct GnomeSettingsManagerPrivate
GDBusNodeInfo *introspection_data;
GDBusConnection *connection;
GSettings *settings;
GnomePnpIds *pnp_ids;
GSList *plugins;
};
......@@ -429,6 +433,9 @@ gnome_settings_manager_start (GnomeSettingsManager *manager,
goto out;
}
g_debug ("loading PNPIDs");
manager->priv->pnp_ids = gnome_pnp_ids_new ();
gnome_settings_profile_start ("initializing plugins");
manager->priv->settings = g_settings_new (DEFAULT_SETTINGS_PREFIX ".plugins");
......@@ -456,6 +463,9 @@ gnome_settings_manager_stop (GnomeSettingsManager *manager)
g_object_unref (manager->priv->settings);
manager->priv->settings = NULL;
g_object_unref (manager->priv->pnp_ids);
manager->priv->pnp_ids = NULL;
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment