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>
This commit is contained in:
Dan McGee 2011-01-28 12:04:27 -06:00 committed by Allan McRae
parent ce54715112
commit 021085624e
1 changed files with 2 additions and 2 deletions

View File

@ -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;