From d68f45f8aaca461167907c07e8c161be14e87157 Mon Sep 17 00:00:00 2001 From: Jeremy Stribling Date: Fri, 25 Aug 2017 13:52:07 -0700 Subject: plumbing: use `seen` map in tree walker This helps avoids iterating down the same trees for every commit. For a big-ish repo with 35K objects (17K commits), this reduced the time for calling `revlist.Objects` during a push (with 0 hashes to ignore) from more than ten minutes to less than a minute. --- plumbing/revlist/revlist.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plumbing/revlist/revlist.go') diff --git a/plumbing/revlist/revlist.go b/plumbing/revlist/revlist.go index f56cf28..5b2ff99 100644 --- a/plumbing/revlist/revlist.go +++ b/plumbing/revlist/revlist.go @@ -137,7 +137,7 @@ func iterateCommitTrees( cb(tree.Hash) - treeWalker := object.NewTreeWalker(tree, true) + treeWalker := object.NewTreeWalker(tree, true, seen) for { _, e, err := treeWalker.Next() -- cgit