git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: git blame vs git log --follow performance

From
Duy Nguyen <pclouds@gmail.com>
Date
Jan 27, 2014, 01:33 UTC
Message-ID
<CACsJy8B4dkjae3tL+_JvD63HCoi_-nNWYGvT3xRTqi8UpYX95g@mail.gmail.com>
In-Reply-To
<1390770652.20150.25.camel@joe-AO722>
On Mon, Jan 27, 2014 at 4:10 AM, Joe Perches <joe@perches.com> wrote:
Show 14 quoted lines
> For instance (using the Linus' linux kernel git):
>
> $ time git log --follow -- drivers/firmware/google/Kconfig > /dev/null
>
> real    0m42.329s
> user    0m40.984s
> sys     0m0.792s
>
> $ time git blame -- drivers/firmware/google/Kconfig > /dev/null
>
> real    0m0.963s
> user    0m0.860s
> sys     0m0.096s
>

It's not fair to compare blame and log. If you compare, compare it to non follow version

$ time git log --follow -- drivers/firmware/google/Kconfig > /dev/null

real 0m35.552s user 0m35.120s sys 0m0.383s

$ time git log -- drivers/firmware/google/Kconfig > /dev/null

real 0m4.366s user 0m4.215s sys 0m0.144s

Although because we need to detect rename, we can't really filter to one path. So the base line is more like

$ time git log > /dev/null

real 0m29.338s user 0m28.485s sys 0m0.813s

with rename detection taking some more time.
Show 5 quoted lines
> Perhaps adding a whole-file rename option to the
> "git log" history simplification mechanism could
> help?
>
> Thoughts?

I tested a version with rename detection logic removed. It did not change the timing significantly. To improve --follow I think we need to do something about path filtering.

-- 
Duy
Previous: Joe PerchesNext: Joe Perches
Message 2 of 4 in “git blame vs git log --follow performance”
  1. Joe PerchesJan 26, 2014
  2. Duy NguyenJan 27, 2014
  3. Joe PerchesJan 27, 2014
  4. Duy NguyenJan 27, 2014

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.