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

Re: Fix "git commit directory/" performance anomaly

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Aug 10, 2007, 17:14 UTC
Message-ID
<alpine.LFD.0.999.0708101008230.30176@woody.linux-foundation.org>
In-Reply-To
<alpine.LFD.0.999.0708100924570.30176@woody.linux-foundation.org>
On Fri, 10 Aug 2007, Linus Torvalds wrote:
>
> This improves the cold-cache case immensely, since we don't need to bring 
> in all the file contents, just the index and any files dirty in the index.

The extreme - but not necessarily unusual - case of this is when the index and stat information is hot-cache (which is quite normal, in case you've done a "git diff" or something like that), but the whole source tree is otherwise not. Then the numbers look like this:

Before:
	[torvalds@woody linux]$ time git commit .
	real    1m33.751s
	user    0m3.864s
	sys     0m2.160s
After:
	[torvalds@woody linux]$ time git commit .
	real    0m1.415s
	user    0m1.176s
	sys     0m0.260s

The all-hot-cache numbers are better too, of course, just not nearly as noticeable:

Before:
	[torvalds@woody linux]$ time git commit .
	real    0m3.960s
	user    0m3.304s
	sys     0m0.672s

(and the after case is that 1.415s above, of course, so it's still more than twice as fast - it's just no longer a 60x performance difference!).

(Honesty in advertising: the "after" numbers also contain the "runstatus" speedup, which is the 0.5s -> 0.3s improvement)

			Linus
Previous: Linus TorvaldsNext: Junio C Hamano
Message 23 of 37 in “git and larger trees, not so fast?”
  1. moeAug 9, 2007
  2. Linus TorvaldsAug 9, 2007
  3. Linus TorvaldsAug 9, 2007
  4. Junio C HamanoAug 9, 2007
  5. Linus TorvaldsAug 9, 2007
  6. Junio C HamanoAug 9, 2007
  7. Junio C HamanoAug 9, 2007
  8. SeanAug 9, 2007
  9. Junio C HamanoAug 9, 2007
  10. Linus TorvaldsAug 9, 2007
  11. Linus TorvaldsAug 9, 2007
  12. Junio C HamanoAug 9, 2007
  13. Junio C HamanoAug 9, 2007
  14. Junio C HamanoAug 10, 2007
  15. Linus TorvaldsAug 10, 2007
  16. Junio C HamanoAug 10, 2007
  17. Linus TorvaldsAug 10, 2007
  18. Junio C HamanoAug 10, 2007
  19. Junio C HamanoAug 10, 2007
  20. Linus TorvaldsAug 10, 2007
  21. Linus TorvaldsAug 10, 2007
  22. Fix "git commit directory/" performance anomalyLinus Torvalds, Aug 10, 2007
  23. Linus TorvaldsAug 10, 2007
  24. Junio C HamanoAug 10, 2007
  25. Linus TorvaldsAug 10, 2007
  26. Daniel BarkalowAug 10, 2007
  27. Linus TorvaldsAug 9, 2007
  28. David KastrupAug 9, 2007
  29. Linus TorvaldsAug 10, 2007
  30. Linus TorvaldsAug 11, 2007
  31. Fernando J. PeredaAug 11, 2007
  32. Linus TorvaldsAug 11, 2007
  33. Fernando J. PeredaAug 11, 2007
  34. Linus TorvaldsAug 11, 2007
  35. David KastrupAug 11, 2007
  36. moeAug 11, 2007
  37. moeAug 23, 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.