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



commit edca808a8ab696a7a3107d63e3cf7defcb44f911
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 a61e2e1..2cea359 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -186,6 +186,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)) {
                return FALSE;
        }
diff --git a/src/plugins/gs-plugin-appstream.c b/src/plugins/gs-plugin-appstream.c
index d27a1c1..5b96f71 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -153,6 +153,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]