Rewrite Reindex around projects
Opening and closing repositories and packs and constantly re-parsing commits and trees thrashes even beefy machines, even when the PatchListCache is hot. Instead, use a single RevWalk per Repository (i.e. project), so we can reuse parsed trees when doing all the tree diffs. Also take advantage of the fact that the set of changed paths without rename detection matches that with rename detection (since we aren't doing find-copies-harder), so skip rename detection. Change-Id: I49b85cc93796332c63d8be8e0ce7b918c98a21f7
This commit is contained in:
@@ -64,7 +64,7 @@ import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
|
||||
public class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
|
||||
static final Logger log = LoggerFactory.getLogger(PatchListLoader.class);
|
||||
|
||||
private final GitRepositoryManager repoManager;
|
||||
@@ -241,7 +241,7 @@ class PatchListLoader extends CacheLoader<PatchListKey, PatchList> {
|
||||
}
|
||||
}
|
||||
|
||||
private static RevObject automerge(Repository repo, RevWalk rw, RevCommit b)
|
||||
public static RevTree automerge(Repository repo, RevWalk rw, RevCommit b)
|
||||
throws IOException {
|
||||
String hash = b.name();
|
||||
String refName = GitRepositoryManager.REFS_CACHE_AUTOMERGE
|
||||
|
Reference in New Issue
Block a user