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. --- remote.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'remote.go') diff --git a/remote.go b/remote.go index 34ea7f5..5869d18 100644 --- a/remote.go +++ b/remote.go @@ -615,7 +615,7 @@ func isFastForward(s storer.EncodedObjectStorer, old, new plumbing.Hash) (bool, } found := false - iter := object.NewCommitPreorderIter(c, nil) + iter := object.NewCommitPreorderIter(c, nil, nil) return found, iter.ForEach(func(c *object.Commit) error { if c.Hash != old { return nil -- cgit