repo: Further optimize ostree_repo_list_objects_set()

In a prior change we discovered that for bad historical reasons
libostree was returning a mapping "object type+checksum" => "metadata"
but the "metadata" was redundant and pointless.

Optimize the prune API to use a (currently internal) object listing
API which returns a set, not a map.  This allows `GHashTable` to
avoid allocating a separate array for the values, neatly cutting
memory usage in half (from ~13MB to ~6MB) on my test case of a
dry-run prune of a FCOS build.
This commit is contained in:
Colin Walters committed 2022-06-08 10:18:55 -04:00
1 parent ef114db341
commit a71915e436
3 files changed
+84 -46

No files matched your search

+6
View File
@@ -513,6 +513,12 @@ _ostree_repo_verify_bindings (const char *collection_id,
GVariant *commit,
GError **error);
GHashTable *
ostree_repo_list_objects_set (OstreeRepo *self,
OstreeRepoListObjectsFlags flags,
GCancellable *cancellable,
GError **error);
/**
* OstreeRepoAutoTransaction:
*