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

Re: absurdly slow git-diff

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Nov 7, 2008, 23:57 UTC
Message-ID
<alpine.LFD.2.00.0811071554590.3468@nehalem.linux-foundation.org>
In-Reply-To
<alpine.DEB.1.10.0811071547080.8736@alien.or.mcafeemobile.com>
On Fri, 7 Nov 2008, Davide Libenzi wrote:
> 
> Yeah, similar. Mine is below. There's one less branch in the for loops.
..and has a comment and made the magic constant be named.

Junio, the time difference is quite big for Abhijit's admittedly odd test-case:

 - Before:
	[torvalds@nehalem slow-diff]$ time git diff 1 2 > out.old
	
	real	2m19.912s
	user	2m19.885s
	sys	0m0.024s
 - After:
	[torvalds@nehalem slow-diff]$ time ~/git/git diff 1 2 > out
	real	0m0.841s
	user	0m0.816s
	sys	0m0.024s
with no difference in output.
			Linus
Previous: Davide LibenziNext: Abhijit Menon-Sen
Message 8 of 13 in “absurdly slow git-diff”
  1. Abhijit Menon-SenNov 7, 2008
  2. Mike HommeyNov 7, 2008
  3. Linus TorvaldsNov 7, 2008
  4. Davide LibenziNov 7, 2008
  5. Davide LibenziNov 7, 2008
  6. Linus TorvaldsNov 7, 2008
  7. Davide LibenziNov 7, 2008
  8. Linus TorvaldsNov 7, 2008
  9. Abhijit Menon-SenNov 8, 2008
  10. Junio C HamanoNov 8, 2008
  11. Junio C HamanoNov 8, 2008
  12. Davide LibenziNov 8, 2008
  13. Pierre HabouzitNov 8, 2008

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.