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

Re: Bad git status performance

From
David Bryson <david@statichacks.org>
Date
Nov 21, 2008, 00:42 UTC
Message-ID
<20081121004242.GD6458@eratosthenes.cryptobackpack.org>
In-Reply-To
<4926009E.4040203@gmx.ch>
Hi,
On Fri, Nov 21, 2008 at 01:28:14AM +0100 or thereabouts, Jean-Luc Herren wrote:
Show 5 quoted lines
> Hi list!
> 
> I'm getting bad performance on 'git status' when I have staged
> many changes to big files.  For example, consider this:
> 
[snip]
Show 19 quoted lines
> $ time git status
> # On branch master
> # Changes to be committed:
> #   (use "git reset HEAD <file>..." to unstage)
> #
> #       modified:   1
> #       modified:   10
> ...
> #       modified:   98
> #       modified:   99
> #
> 
> real    0m16.291s
> user    0m16.054s
> sys     0m0.221s
> 
> The first 'git status' shows the same difference as the second,
> just the second time it's staged instead of unstaged.  Why does it
> take 16 seconds the second time when it's instant the first time?

I had similar problems with a repository that contained several tarballs of gcc and the linux kernel(don't ask me why it was not my repository).

Some weeks ago I mentioned this on IRC, and the problem really was not necessarily git. The way it was explained to me(and please correct or clairify where I am wrong) is that git asked linux for the status of those files and being that they are so large they were swapped out of memory.

The result is the kernel reading those large files back in to see if they have changed at all. My impression is that this is not a git bug but a cache-tuning problem.

Dave
Previous: Jean-Luc HerrenNext: Jean-Luc Herren
Message 2 of 5 in “Bad git status performance”
  1. Jean-Luc HerrenNov 21, 2008
  2. David BrysonNov 21, 2008
  3. Jean-Luc HerrenNov 21, 2008
  4. Michael J GruberNov 21, 2008
  5. Jean-Luc HerrenNov 21, 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.