Radish alpha
H
rad:z3QDZAW2FAfuLvihrhiyDC9fAD8G9
HardenedBSD Package Manager
Radicle
Git
Speed up a few remote repo handling by using mmap in sqlite
Baptiste Daroussin committed 6 years ago
commit 0d2d3353ef8850badc428800e60fe98fab8d4e64
parent 3d5ecc3
2 files changed +3 -0
modified libpkg/pkgdb.c
@@ -1191,6 +1191,7 @@ retry:
			pkgdb_close(db);
			return (EPKG_FATAL);
		}
+
		sql_exec(db->sqlite, "PRAGMA mmap_size=268435456;");
	}

	if (type == PKGDB_REMOTE || type == PKGDB_MAYBE_REMOTE) {
modified libpkg/repo/binary/init.c
@@ -488,6 +488,8 @@ pkg_repo_binary_init(struct pkg_repo *repo)
	retcode = sql_exec(sqlite, "PRAGMA foreign_keys=on");
	if (retcode != EPKG_OK)
		return (retcode);
+
	sql_exec(sqlite, "PRAGMA mmap_size=268435456;");
+


	pkgdb_sqlcmd_init(sqlite, NULL, NULL);