Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDan McGee <dan@archlinux.org>2011-01-28 12:04:27 -0600
committerAllan McRae <allan@archlinux.org>2011-02-04 09:55:45 +1000
commit021085624ea94a7116c60552e5c153de6cb5f057 (patch)
tree2791cb89ef508d761d68e0f8ac4ab8444902891b /lib
parentce5471511257ada996bfcb6ea4236cd89c0d6890 (diff)
Change default sync hash table sizing to 66% full
Since the sync database never changes size once we initialize it, we allow it to be filled a bit more. This reduces the overall memory footprint needed by the hash table. Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/libalpm/be_sync.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libalpm/be_sync.c b/lib/libalpm/be_sync.c
index 2c70e2c5..4ad045c2 100644
--- a/lib/libalpm/be_sync.c
+++ b/lib/libalpm/be_sync.c
@@ -232,8 +232,8 @@ static int sync_db_populate(pmdb_t *db)
}
est_count = estimate_package_count(&buf, archive);
- /* initialize hash at 50% full */
- db->pkgcache = _alpm_pkghash_create(est_count * 2);
+ /* initialize hash at 66% full */
+ db->pkgcache = _alpm_pkghash_create(est_count * 3 / 2);
while(archive_read_next_header(archive, &entry) == ARCHIVE_OK) {
const struct stat *st;