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

Re: Debugging git-commit slowness on a large repo

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 20, 2011, 01:21 UTC
Message-ID
<7vehw0kphc.fsf@alter.siamese.dyndns.org>
In-Reply-To
<CB1518AB.2D649%joshua.redstone@fb.com>
Joshua Redstone <joshua.redstone@fb.com> writes:
Show 11 quoted lines
> I've managed to speed up git-commit on large repos by 4x by removing some
> safeguards that caused git to stat every file in the repo on commits that
> touch a small number of files.  The diff, for illustrative purposes only,
> is at:
>
>     https://gist.github.com/1499621
>
>
> With a repo with 1 million files (but few commits), the diff drops the
> commit time down from 7.3 seconds to 1.8 seconds, a 75% decrease. The
> optimizations are:

I do not know if these kind of changes are called "optimizations" or merely making the command record a random tree object that may have some resemblance to what you wanted to commit but is subtly incorrect. I didn't fetch your safety removal, though.

Wouldn't you get a similar speed-up without being unsafe if you simply ran "git commit" without any parameter (i.e. write out the current index as a tree and make a commit), combined with "--no-status" and perhaps "-q" to avoid running the comparison between the resulting commit and the working tree state after the commit?

Previous: Joshua RedstoneNext: Joshua Redstone
Message 12 of 16 in “Debugging git-commit slowness on a large repo”
  1. Joshua RedstoneDec 2, 2011
  2. Carlos Martín NietoDec 3, 2011
  3. Junio C HamanoDec 5, 2011
  4. Joshua RedstoneDec 7, 2011
  5. Nguyen Thai Ngoc DuyDec 7, 2011
  6. Joshua RedstoneDec 7, 2011
  7. Nguyen Thai Ngoc DuyDec 8, 2011
  8. Joshua RedstoneDec 9, 2011
  9. Joshua RedstoneDec 9, 2011
  10. Joshua RedstoneDec 13, 2011
  11. Joshua RedstoneDec 20, 2011
  12. Junio C HamanoDec 20, 2011
  13. Joshua RedstoneDec 20, 2011
  14. Thomas RastDec 20, 2011
  15. Joshua RedstoneDec 20, 2011
  16. Tomas CarneckyDec 4, 2011

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.