Re: how to speed up "git log"?

From: Johannes Schindelin <>
Date: 2007-02-12 03:49:03

On Sun, 11 Feb 2007, Bruno Haible wrote:

> 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

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?


To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to
More majordomo info at
Received on Mon Feb 12 03:52:48 2007

This archive was generated by hypermail 2.1.8 : 2007-02-12 03:54:20 EST