Git development
 help / color / mirror / Atom feed
* absurdly slow git-diff
@ 2008-11-07 20:01 Abhijit Menon-Sen
  2008-11-07 21:28 ` Mike Hommey
  2008-11-07 21:37 ` Linus Torvalds
  0 siblings, 2 replies; 13+ messages in thread
From: Abhijit Menon-Sen @ 2008-11-07 20:01 UTC (permalink / raw)
  To: git

I have a 240k-line file, and I change one character on every sixth line.
The resulting diff gives git serious indigestion:

$ git --version
git version 1.6.0.3.640.g6331a
$ mkdir a; cd a; git init
Initialized empty Git repository in /home/ams/a/.git/
$ cp ../1 .; git add 1; git commit -q -m 1
$ cp ../2 1; git add 1; git commit -q -m 2 
$ time git show HEAD > x
git show HEAD > x  309.88s user 0.46s system 97% cpu 5:17.06 total

(I use commit -q above not only for brevity; for the second commit,
calculating the diffstat takes the same five minutes that git show,
git log -p, git log --stat etc. all take.)

Note that diff(1) can handle the patch fine:

$ time diff -u ../1 ../2 >/dev/null
diff -u ../1 ../2 > /dev/null  0.30s user 0.06s system 69% cpu 0.519 total

If anyone's interested, the files are http://toroid.org/misc/1 and
http://toroid.org/misc/2

Does anyone understand why this slowdown might happen or have
suggestions about where I should look for it?

Thanks.

-- ams

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

end of thread, other threads:[~2008-11-08 21:04 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-07 20:01 absurdly slow git-diff Abhijit Menon-Sen
2008-11-07 21:28 ` Mike Hommey
2008-11-07 21:37 ` Linus Torvalds
2008-11-07 23:04   ` Davide Libenzi
2008-11-07 23:18     ` Davide Libenzi
2008-11-07 23:42       ` Linus Torvalds
2008-11-07 23:48         ` Davide Libenzi
2008-11-07 23:57           ` Linus Torvalds
2008-11-08  4:57             ` Abhijit Menon-Sen
2008-11-08 21:02             ` Junio C Hamano
2008-11-08  5:30           ` Junio C Hamano
2008-11-08 16:27             ` Davide Libenzi
2008-11-08  0:14   ` Pierre Habouzit

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox