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

Re: Debugging git-commit slowness on a large repo

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Dec 7, 2011, 02:08 UTC
Message-ID
<CACsJy8Dbd+v+8FzvQS9a4C8DQSxQGgqQNGaLhL1cHv-yMnaCJQ@mail.gmail.com>
In-Reply-To
<CB04005C.2C669%joshua.redstone@fb.com>
On Wed, Dec 7, 2011 at 8:48 AM, Joshua Redstone <joshua.redstone@fb.com> wrote:
> I tried doing a 'git read-tree HEAD' before each 'git add ; git commit'
> iteration, and the time for git-commit jumped from about 1 second to about
> 8 seconds.  That is a pretty dramatic slowdown.  Any idea why?  I wonder
> if that's related to the overall commit slowness.

How big is your working directory? "git ls-files | wc -l" should show it. Try "git read-tree HEAD; git add; git write-tree" and see if the write-tree part takes as much time as commit. write-tree is mainly about cache-tree generation.

> @Carlos and/or @Junio, can you point me at any docs/code to understand
> what a tree-cache is and how it differs from the index?  I did a google
> search for [git tree-cache index], but nothing popped out.

Have a look at Documentation/technical/index-format.txt. Cache tree extension is near the end.

-- 
Duy
Previous: Joshua RedstoneNext: Joshua Redstone
Message 5 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.