This repository was archived by the owner on Sep 11, 2020. It is now read-only.
This repository was archived by the owner on Sep 11, 2020. It is now read-only.
Tree iteration performance #636
Open
Description
I'm trying to iterate a tree and list filenames and their hashes within a repo, using https://gist.github.com/tajtiattila/f7357e2536c5ae5b411607ebfa71d5e9
However the performance seems to be at least two orders of magnitude slower than that of Git. Is there a better way to do it?
My intent was to use go-git to check changed files in a custom pre-commit hook for git.
OS is Windows 10. Repo is on an SSD and has large with binary files in it.
$ du -h -s .git
4.9G .git
$ time git ls-tree --full-tree -r e2f631e842beb18cdc81cd1551ca38367a62dd76 >/dev/null
real 0m0.163s
user 0m0.000s
sys 0m0.000s
$ time commititer e2f631e842beb18cdc81cd1551ca38367a62dd76 >/dev/null
real 0m29.752s
user 0m0.000s
sys 0m0.016s
$