Skip to content

Commit

Permalink
add note go ODB initialization in preparation for dealing with many s…
Browse files Browse the repository at this point in the history
…mall 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`.
  • Loading branch information
Byron committed Aug 2, 2023
1 parent 73ec02b commit 090357e
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions gix-odb/src/store_impls/dynamic/load_index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -493,6 +493,11 @@ impl super::Store {
// Unlike libgit2, do not sort by modification date, but by size and put the biggest indices first. That way
// the chance to hit an object should be higher. We leave it to the handle to sort by LRU.
// Git itself doesn't change the order which may safe time, but we want it to be stable which also helps some tests.
// NOTE: this will work well for well-packed repos or those using geometric repacking, but force us to open a lot
// of files when dealing with new objects, as there is no notion of recency here as would be with unmaintained
// repositories. Different algorithms should be provided, like newest packs first, and possibly a mix of both
// with big packs first, then sorting by recency for smaller packs.
// We also want to implement `fetch.unpackLimit` to alleviate this issue a little.
indices_by_modification_time.sort_by(|l, r| l.2.cmp(&r.2).reverse());
Ok(indices_by_modification_time)
}
Expand Down

0 comments on commit 090357e

Please sign in to comment.