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

Re: speed of git reset -- file

From
Jeff King <peff@peff.net>
Date
Jun 1, 2011, 22:56 UTC
Message-ID
<20110601225647.GD16820@sigill.intra.peff.net>
In-Reply-To
<20110601220502.GA28493@gnu.kitenet.net>
On Wed, Jun 01, 2011 at 06:05:02PM -0400, Joey Hess wrote:
Show 12 quoted lines
> Jeff King wrote:
> > > My experience with semi-large trees[1] is that I have to remember to use
> > > "git status ." in a subdir; that "git commit -a" is of course slow when
> > > I need to use it; and that the index gets big and things that need to
> > > update it can become somewhat slow especially on slow disks, but that
> > 
> > Generally I find that the stats are very fast because everything is in
> > cache, and the disk doesn't come into it at all. Are you on an OS
> > besides Linux, or on a machine with low memory?
> 
> I have Linux and a gigabyte of ram and a not particularly good SSD.
> Here `git reset file` takes 30 seconds, `git status` 45 seconds.

OK, that's horrific. For me, the stat information for linux-2.6 all sits in cache and it takes about 0.3 seconds to refresh the index. I have 8G of ram and a nice SSD, though it doesn't actually hit the disk at all.

Is it really faulting the stat information from disk that takes so long? Have you tried running "perf" on "git update-index --refresh"?

-Peff
Previous: Joey HessNext: Joey Hess
Message 12 of 17 in “speed of git reset -- file”
  1. Joey HessMay 31, 2011
  2. Jeff KingMay 31, 2011
  3. Junio C HamanoMay 31, 2011
  4. Jeff KingMay 31, 2011
  5. Matthieu MoyMay 31, 2011
  6. Nguyen Thai Ngoc DuyJun 1, 2011
  7. Junio C HamanoMay 31, 2011
  8. Jeff KingJun 1, 2011
  9. Joey HessJun 1, 2011
  10. Jeff KingJun 1, 2011
  11. Joey HessJun 1, 2011
  12. Jeff KingJun 1, 2011
  13. Joey HessJun 1, 2011
  14. Jeff KingJun 2, 2011
  15. Joey HessJun 2, 2011
  16. Joey HessJun 2, 2011
  17. Junio C HamanoJun 1, 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.