From 841b62a321b3739381b48aeea7364126d1c54520 Mon Sep 17 00:00:00 2001 From: Jeremy Stribling Date: Fri, 8 Sep 2017 17:51:38 -0700 Subject: plumbing: the commit walker can skip externally-seen commits When the revlist is computing the set of hashes needed to transfer, it doesn't need to walk over commits it has already processed. So, it can instruct the commit walker not to walk those commits by passing in its own `seen` map. For a 36K object repo, this brought the time for `revlist.Objects` down from 50s to 30s. --- plumbing/revlist/revlist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plumbing/revlist') diff --git a/plumbing/revlist/revlist.go b/plumbing/revlist/revlist.go index 10a5813..009fc93 100644 --- a/plumbing/revlist/revlist.go +++ b/plumbing/revlist/revlist.go @@ -108,7 +108,7 @@ func reachableObjects( ignore []plumbing.Hash, cb func(h plumbing.Hash), ) error { - i := object.NewCommitPreorderIter(commit, ignore) + i := object.NewCommitPreorderIter(commit, seen, ignore) for { commit, err := i.Next() if err == io.EOF { -- cgit