From 021085624ea94a7116c60552e5c153de6cb5f057 Mon Sep 17 00:00:00 2001 From: Dan McGee Date: Fri, 28 Jan 2011 12:04:27 -0600 Subject: 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 --- lib/libalpm/be_sync.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'lib') 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; -- cgit v1.2.3-24-g4f1b