Skip to content

Commit 090357e

Browse files
committed
add note go ODB initialization in preparation for dealing with many small packs.
When fetching, currently each of these creates a possibly small pack. We can tackle this in many areas, so ideally there is a best algorithm for this, maybe it is indeed just recency, or there is a selection. Have to figure that out. Further, small packs should be exploded, using `fetch.unpackLimit`.
1 parent 73ec02b commit 090357e

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

gix-odb/src/store_impls/dynamic/load_index.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,11 @@ impl super::Store {
493493
// Unlike libgit2, do not sort by modification date, but by size and put the biggest indices first. That way
494494
// the chance to hit an object should be higher. We leave it to the handle to sort by LRU.
495495
// Git itself doesn't change the order which may safe time, but we want it to be stable which also helps some tests.
496+
// NOTE: this will work well for well-packed repos or those using geometric repacking, but force us to open a lot
497+
// of files when dealing with new objects, as there is no notion of recency here as would be with unmaintained
498+
// repositories. Different algorithms should be provided, like newest packs first, and possibly a mix of both
499+
// with big packs first, then sorting by recency for smaller packs.
500+
// We also want to implement `fetch.unpackLimit` to alleviate this issue a little.
496501
indices_by_modification_time.sort_by(|l, r| l.2.cmp(&r.2).reverse());
497502
Ok(indices_by_modification_time)
498503
}

0 commit comments

Comments
 (0)