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

Re: how to speed up "git log"?

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Feb 11, 2007, 16:49 UTC
Message-ID
<Pine.LNX.4.63.0702111745170.22628@wbgn013.biozentrum.uni-wuerzburg.de>
In-Reply-To
<200702111252.28393.bruno@clisp.org>
Hi,
On Sun, 11 Feb 2007, Bruno Haible wrote:
Show 8 quoted lines
> Are there some known tricks to speed up the operation of "git log"?
> 
> On a file in a local copy of the coreutils git repository,
> "git log tr.c > output" takes
>   - 33 seconds of CPU time (33 user, 0 system) on a Linux/x86 500MHz system,
>   - 24 seconds of CPU time (12 user, 12 system) on a MacOS X PowerPC 1.1 GHz
>     system.
> The result shows only 147 commits and a total of 40 KB textual output.

Yes, because there were only 147 commits which changed the file. But git looked at all commits to find that.

Basically, we don't do file versions. File versions do not make sense, since they strip away the context. See also

http://news.gmane.org/group/gmane.comp.version-control.git/thread=37838
for a real flamewar revolving around that very subject.
> 1) Why so much user CPU time?
See above.

Plus, you are probably not really interested in _all_ revisions changing that file, are you? Usually the output of git-log -- even with pathname filtering -- starts almost instantaneous, and is piped to your pager. So, your numbers are misleading.

> 2) Why so much system CPU time, but only on MacOS X?
Probably the mmap() problem. Does it go away when you use git 1.5.0-rc4?

Hth, Dscho

Previous: Bruno HaibleNext: Shawn O. Pearce
Message 2 of 23 in “how to speed up "git log"?”
  1. Bruno HaibleFeb 11, 2007
  2. Johannes SchindelinFeb 11, 2007
  3. Shawn O. PearceFeb 11, 2007
  4. Johannes SchindelinFeb 11, 2007
  5. Bruno HaibleFeb 11, 2007
  6. Shawn O. PearceFeb 11, 2007
  7. Johannes SchindelinFeb 11, 2007
  8. Robin RosenbergFeb 11, 2007
  9. Bruno HaibleFeb 12, 2007
  10. Johannes SchindelinFeb 12, 2007
  11. Junio C HamanoFeb 12, 2007
  12. Shawn O. PearceFeb 12, 2007
  13. Junio C HamanoFeb 12, 2007
  14. Shawn O. PearceFeb 12, 2007
  15. Shawn O. PearceFeb 12, 2007
  16. Linus TorvaldsFeb 12, 2007
  17. Bruno HaibleFeb 12, 2007
  18. Bruno HaibleFeb 11, 2007
  19. Bruno HaibleFeb 17, 2007
  20. Johannes SchindelinFeb 17, 2007
  21. Bruno HaibleFeb 18, 2007
  22. Johannes SchindelinFeb 18, 2007
  23. Shawn O. PearceFeb 18, 2007

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.