git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why is --pretty=format: so slow?
@ 2007-11-04  3:42 Paul Mackerras
  2007-11-04  4:22 ` Junio C Hamano
  0 siblings, 1 reply; 5+ messages in thread
From: Paul Mackerras @ 2007-11-04  3:42 UTC (permalink / raw)
  To: Junio C Hamano, git

For some reason, using --pretty=format:... with git log is much slower
than other formats.  For example, on the kernel tree (on my quad G5):

$ time git log --pretty=oneline >/dev/null

real    0m2.165s
user    0m2.092s
sys     0m0.070s

$ time git log --pretty=raw >/dev/null

real    0m2.426s
user    0m2.358s
sys     0m0.068s

$ time git log --pretty="format:%H" >/dev/null

real    0m7.843s
user    0m6.282s
sys     0m1.557s

$ time git log --pretty="format:%H {%P} %ct" >/dev/null

real    0m7.950s
user    0m6.374s
sys     0m1.573s

Strace seems to indicate that git log is doing at least one sequence
of open, fstat64, fcntl64, getdents64 and close for each line of
output in the --pretty=format: cases, but not in the other cases.
This seems rather unnecessary - could it be fixed?  I'd like to use
the last format listed above with gitk, but not if it is going to make
things 3 times slower.

Paul.

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-11-04 13:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-04  3:42 Why is --pretty=format: so slow? Paul Mackerras
2007-11-04  4:22 ` Junio C Hamano
2007-11-04 10:31   ` René Scharfe
2007-11-04 11:48     ` Junio C Hamano
2007-11-04 13:53       ` René Scharfe

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).