From: Duy Nguyen Date: Mon, 27 Jan 2014 02:34:23 GMT Subject: Re: git blame vs git log --follow performance Message-ID: In-Reply-To: <1390770652.20150.25.camel@joe-AO722> On Mon, Jan 27, 2014 at 4:10 AM, Joe Perches wrote: > Is there something that can be done about improving > git log --follow -- performance to be nearly > equivalent speed to git blame -- ? Not strictly about --follow, but there is room for improvement for diff'ing in log in general. Right now we do "diff HEAD HEAD~1", "diff HEAD~1 HEAD~2" and so on (--follow needs diff to detect rename). At each step we load new tree objects and reparse. Notice after "diff HEAD HEAD~1" we may have "HEAD~1" and its subtrees read and parsed (not entirely). We could reuse that "diff HEAD~1 HEAD~2". On git.git, "git log --raw" takes 10s and it seems tree object reading is about 2s.In ideal case we might be able to cut that to 1s. The tree parsing code (update_tree_entry) takes about 5s. We might be able to cut that in half, I'm not entirely sure. But there could be a lot of work in caching "HEAD~1" and the overhead may turn out too high for any gain. -- Duy