aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/treenoder.go
diff options
context:
space:
mode:
authorJeremy Stribling <strib@alum.mit.edu>2017-08-25 13:52:07 -0700
committerJeremy Stribling <strib@alum.mit.edu>2017-08-27 17:14:49 -0700
commitd68f45f8aaca461167907c07e8c161be14e87157 (patch)
tree1fecddbe0c384ab077e5588321362a672f0e9fc4 /plumbing/object/treenoder.go
parent631a45f55b397090ad7d817a3c72041cfc3729f3 (diff)
downloadgo-git-d68f45f8aaca461167907c07e8c161be14e87157.tar.gz
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.
Diffstat (limited to 'plumbing/object/treenoder.go')
-rw-r--r--plumbing/object/treenoder.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/plumbing/object/treenoder.go b/plumbing/object/treenoder.go
index bd65abc..52f0e61 100644
--- a/plumbing/object/treenoder.go
+++ b/plumbing/object/treenoder.go
@@ -99,7 +99,7 @@ func transformChildren(t *Tree) ([]noder.Noder, error) {
// is bigger than needed.
ret := make([]noder.Noder, 0, len(t.Entries))
- walker := NewTreeWalker(t, false) // don't recurse
+ walker := NewTreeWalker(t, false, nil) // don't recurse
// don't defer walker.Close() for efficiency reasons.
for {
_, e, err = walker.Next()