]> source.dussan.org Git - jgit.git/commit
PackWriterBitmapPreparer: Set limit on excessive branch count 07/1174407/21
authorJackson Toeniskoetter <jackdt@google.com>
Wed, 10 Jan 2024 21:34:48 +0000 (21:34 +0000)
committerIvan Frade <ifrade@google.com>
Fri, 12 Jan 2024 23:39:45 +0000 (23:39 +0000)
commitee44430913c6e734e4786146a8ec5e38f551c517
treea9b30fec1aac8bee488e1dbbd7ccf3870a29c861
parentb1cc74b75b771279d81de15833da514c71513648
PackWriterBitmapPreparer: Set limit on excessive branch count

If there are too many branches then the bitmap
indexing selects only the tip commits of the least active
branches to reduce the amount of bitmaps to load on request.
This can still be a problem if the number of inactive branches
rival or exceed the total number of commits selected
for the active branches.

Limit the number of branches that receive only-tip bitmaps.
This reduces the memory pressure of loading all the bitmaps,
and allows us to model the size of the bitmap index without
considering the number of branches.

Bitmaps are generated for branches in order of most recent commit,
and follow these rules:

* The first {@code DEFAULT_BITMAP_EXCESSIVE_BRANCH_COUNT} most active
  branches have full bitmap coverage.
* The {@code DEFAULT_BITMAP_EXCESSIVE_BRANCH_COUNT} to {@code
  DEFAULT_BITMAP_EXCESSIVE_BRANCH_TIP_COUNT} most active branches have
  only the tip commit covered.
* The remaining branches have no bitmap coverage.

To prevent effecting existing repositories, the default value is set
at Integer.MAX_VALUE.

Change-Id: I7cc53c898cdc04953b95669be0b069543e10c6f8
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java
org.eclipse.jgit/src/org/eclipse/jgit/lib/ConfigConstants.java
org.eclipse.jgit/src/org/eclipse/jgit/storage/pack/PackConfig.java