[gnome-software] Do not index the description in the search cache



commit dd5d54adf32aed6fa8d8d678578d68889cb52d89
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 3 18:53:33 2016 +0000

    Do not index the description in the search cache
    
    This improves startup speed by 180ms and reduces the RSS by ~100kb.

 src/plugins/gs-flatpak.c          |    7 +++++++
 src/plugins/gs-plugin-appstream.c |    7 +++++++
 2 files changed, 14 insertions(+), 0 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index 54300c4..32b8ae3 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -230,6 +230,13 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
        as_store_set_add_flags (store,
                                AS_STORE_ADD_FLAG_USE_UNIQUE_ID |
                                AS_STORE_ADD_FLAG_ONLY_NATIVE_LANGS);
+       as_store_set_search_match (store,
+                                  AS_APP_SEARCH_MATCH_MIMETYPE |
+                                  AS_APP_SEARCH_MATCH_PKGNAME |
+                                  AS_APP_SEARCH_MATCH_COMMENT |
+                                  AS_APP_SEARCH_MATCH_NAME |
+                                  AS_APP_SEARCH_MATCH_KEYWORD |
+                                  AS_APP_SEARCH_MATCH_ID);
        if (!as_store_from_file (store, file, NULL, cancellable, error)) {
                gs_utils_error_convert_appstream (error);
                return FALSE;
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index eafe328..3a19a7a 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -167,6 +167,13 @@ gs_plugin_initialize (GsPlugin *plugin)
        as_store_set_watch_flags (priv->store,
                                  AS_STORE_WATCH_FLAG_ADDED |
                                  AS_STORE_WATCH_FLAG_REMOVED);
+       as_store_set_search_match (priv->store,
+                                  AS_APP_SEARCH_MATCH_MIMETYPE |
+                                  AS_APP_SEARCH_MATCH_PKGNAME |
+                                  AS_APP_SEARCH_MATCH_COMMENT |
+                                  AS_APP_SEARCH_MATCH_NAME |
+                                  AS_APP_SEARCH_MATCH_KEYWORD |
+                                  AS_APP_SEARCH_MATCH_ID);
 
        /* set plugin flags */
        gs_plugin_add_flags (plugin, GS_PLUGIN_FLAGS_GLOBAL_CACHE);


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