git/indexer: Start with more gitoxide slot space; reduce #22
Diff
src/database/indexer.rs | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
@@ -39,6 +39,10 @@
info!("Starting index update");
update_repository_metadata(scan_path, repository_list, db);
update_repository_reflog(scan_path, db.clone());
update_repository_tags(scan_path, db.clone());
@@ -602,6 +606,19 @@
fn get_relative_path<'a>(relative_to: &Path, full_path: &'a Path) -> Option<&'a Path> {
full_path.strip_prefix(relative_to).ok()
}
fn gix_open_options() -> gix::open::Options {
gix::open::Options::default()
.object_store_slots(
gix::odb::store::init::Slots::AsNeededByDiskState {
multiplier: 1.5,
minimum: 512,
}
)
.open_path_as_is(true)
}
fn discover_repositories(
@@ -651,7 +668,7 @@
};
for dir in dirs {
match gix::open_opts(&dir, gix::open::Options::default().open_path_as_is(true)) {
match gix::open_opts(&dir, gix_open_options()) {
Ok(mut repo) => {
repo.object_cache_size(10 * 1024 * 1024);
discovered_repos.push((dir, repo));