[gnome-software] Only load native languages from the AppStream file



commit 668242b521167659c46636dd5a7b50e723ab5cff
Author: Richard Hughes <richard hughsie com>
Date:   Thu Nov 3 18:52:39 2016 +0000

    Only load native languages from the AppStream file
    
    This speeds up startup by ~200ms and reduces the RSS by 12Mb.

 src/plugins/gs-flatpak.c          |    4 +++-
 src/plugins/gs-plugin-appstream.c |    1 +
 2 files changed, 4 insertions(+), 1 deletions(-)
---
diff --git a/src/plugins/gs-flatpak.c b/src/plugins/gs-flatpak.c
index e179a81..54300c4 100644
--- a/src/plugins/gs-flatpak.c
+++ b/src/plugins/gs-flatpak.c
@@ -227,7 +227,9 @@ gs_flatpak_add_apps_from_xremote (GsFlatpak *self,
        }
        file = g_file_new_for_path (appstream_fn);
        store = as_store_new ();
-       as_store_set_add_flags (store, AS_STORE_ADD_FLAG_USE_UNIQUE_ID);
+       as_store_set_add_flags (store,
+                               AS_STORE_ADD_FLAG_USE_UNIQUE_ID |
+                               AS_STORE_ADD_FLAG_ONLY_NATIVE_LANGS);
        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 8b8dd95..eafe328 100644
--- a/src/plugins/gs-plugin-appstream.c
+++ b/src/plugins/gs-plugin-appstream.c
@@ -162,6 +162,7 @@ gs_plugin_initialize (GsPlugin *plugin)
                          plugin);
        as_store_set_add_flags (priv->store,
                                AS_STORE_ADD_FLAG_USE_UNIQUE_ID |
+                               AS_STORE_ADD_FLAG_ONLY_NATIVE_LANGS |
                                AS_STORE_ADD_FLAG_USE_MERGE_HEURISTIC);
        as_store_set_watch_flags (priv->store,
                                  AS_STORE_WATCH_FLAG_ADDED |


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