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

Re: Some git performance measurements..

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 30, 2007, 05:00 UTC
Message-ID
<7v3auos4yi.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<alpine.LFD.0.9999.0711290945060.8458@woody.linux-foundation.org>
Linus Torvalds <torvalds@linux-foundation.org> writes:
Show 6 quoted lines
> Umm. See my earlier numbers. For "git checkout" with cold cache, the 
> *bulk* of the time is actually the ".gitignore" file lookups, so if you 
> see a three-second improvement out of 17s, it may not look spectacular, 
> but considering that probably 10s of those 17s were something *else* going 
> on, I suspect that if you really did just a plain "git checkout", you 
> actually *do* have a spectacular improvement of roughly 7s -> 4s!

I am hoping that "probably 10s of those 17s" can actually be measured with the patch I sent out last night. Has anybody took a look at it?

Partitioning the pack data by object type shifts the tradeoffs from the current "the data in the same tree are mostly together, except commits are treated differently because rev walk is done quite often" layout. Because we do not ever look at blob objects while pruning the history (unless the -Spickaxe option is used, I think), partitioned layout would optimize ancestry walking even more than the current packfile layout.

On the other hand, any operation that wants to look at the contents are penalized. A two-tree diff that inspects the contents (e.g. fuzzy renames and pickaxe) needs to read from the tree section to find which blob to compare with which other blob, and and then needs to seek to the blob section to actually read the contents, while the current layout tends to group both trees and blobs that belong to the same tree together. It is natural that blame is penalized by the new layout, mostly because it needs to grab two blobs to compare from parent-child pair, but also because it needs to find two-tree diffs for parent-child pair it traverses whenever it needs to follow across renames (that is, when it sees there is no corresponding path in the parent). I would expect to see similar slowdown from grep which wants to inspect blobs that are in the same tree.

When I do archaeology, I think I often run blame first to see which change made the block of text into the current shape first, and then run a path limited "git log -p" either starting or ending at that revision. In that workflow, the initial blame may get slower with the new layout, but I suspect it would help by speeding up the latter "git log -p" step.

Previous: Nicolas PitreNext: Linus Torvalds
Message 8 of 28 in “Some git performance measurements..”
  1. Linus TorvaldsNov 29, 2007
  2. Linus TorvaldsNov 29, 2007
  3. Nicolas PitreNov 29, 2007
  4. Linus TorvaldsNov 29, 2007
  5. Nicolas PitreNov 29, 2007
  6. Linus TorvaldsNov 29, 2007
  7. Nicolas PitreNov 29, 2007
  8. Junio C HamanoNov 30, 2007
  9. Linus TorvaldsNov 30, 2007
  10. Jakub NarebskiNov 30, 2007
  11. Linus TorvaldsNov 30, 2007
  12. Jakub NarebskiNov 30, 2007
  13. Nicolas PitreNov 30, 2007
  14. Steffen ProhaskaNov 30, 2007
  15. Mike RalphsonDec 7, 2007
  16. Johannes SchindelinDec 7, 2007
  17. Linus TorvaldsDec 7, 2007
  18. Mike RalphsonDec 7, 2007
  19. Johannes SchindelinDec 7, 2007
  20. Mike RalphsonDec 7, 2007
  21. Johannes SchindelinDec 8, 2007
  22. Brian DowningDec 8, 2007
  23. Linus TorvaldsNov 30, 2007
  24. Federico Mena QuinteroDec 5, 2007
  25. Joachim B HagaDec 1, 2007
  26. Linus TorvaldsDec 1, 2007
  27. Junio C HamanoNov 29, 2007
  28. per-directory-exclude: lazily read .gitignore filesJunio C Hamano, Nov 29, 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.