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/object/file.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'plumbing/object/file.go') diff --git a/plumbing/object/file.go b/plumbing/object/file.go index 79f57fe..40b5206 100644 --- a/plumbing/object/file.go +++ b/plumbing/object/file.go @@ -81,7 +81,7 @@ type FileIter struct { // NewFileIter takes a storer.EncodedObjectStorer and a Tree and returns a // *FileIter that iterates over all files contained in the tree, recursively. func NewFileIter(s storer.EncodedObjectStorer, t *Tree) *FileIter { - return &FileIter{s: s, w: *NewTreeWalker(t, true)} + return &FileIter{s: s, w: *NewTreeWalker(t, true, nil)} } // Next moves the iterator to the next file and returns a pointer to it. If -- cgit