]> source.dussan.org Git - jgit.git/commit
Use 'reused' bitmap to filter tip commit setup walk 95/59595/4
authorJonathan Nieder <jrn@google.com>
Tue, 3 Nov 2015 19:15:36 +0000 (11:15 -0800)
committerJonathan Nieder <jrn@google.com>
Thu, 5 Nov 2015 20:25:32 +0000 (12:25 -0800)
commit9d4e5216a67865e0b5f068e44b01997542583f87
treeb2a192b3470c458384c08b78dae55339fe3251f7
parent99d404009428ef42658cf1aa78069ee5382f6bd7
Use 'reused' bitmap to filter tip commit setup walk

When garbage collecting, we decide to reuse some bitmaps in older
history from the previous pack to save time.  The remainder of commit
selection only involves commits not covered by those bitmaps.

Currently we carry that out in two ways:

1. by building a bitmap representing the already-covered commits,
   for easy containment checks and AND-NOT-ing against
2. by marking the reused bitmap commits as uninteresting in the
   RevWalk that finds new commits

The mechanism in (2) is less efficient than (1): rw.next() will walk
back from reused bitmap commits to check whether the commit it is
about to emit is an ancestor of them, when using the bitmap from (1)
would let us perform the same check with a single contains() call.
Add a RevFilter teaching the RevWalk to perform that same check
directly using the bitmap from (1).

The next time the RevWalk is used, a different RevFilter is installed
so this does not break that.

A later commit will drop the markUninteresting calls.

No functional change intended except a possible speedup.

Change-Id: Ic375210fa69330948be488bf9dbbe4cb0d069ae6
org.eclipse.jgit/src/org/eclipse/jgit/internal/storage/pack/PackWriterBitmapPreparer.java