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

Re: Git very slow ?

From
KMKen Moffat <zarniwhoop@ntlworld.com>
Date
Mar 8, 2015, 23:31 UTC
Message-ID
<20150308233154.GB3792@milliways>
In-Reply-To
<CA+55aFwn9vOWAL_9eHQt+kQN16j3+nQLeibWos86g5T_RZEizg@mail.gmail.com>
On Sun, Mar 08, 2015 at 12:39:10PM -0700, Linus Torvalds wrote:
Show 12 quoted lines
> On Sun, Mar 8, 2015 at 12:02 PM, Ken Moffat <zarniwhoop@ntlworld.com> wrote:
> >
> > The comments on git bisect were for linus'skernel tree, on a local
> > disk.  2.3GB of repo, just under 57000 files.
> 
> Ugh. I hope you are talking about checked-out size.
> 
>     [torvalds@i7 linux]$ du -sh .git
>    850M .git
> 
> because otherwise it sounds like that repo hasn't been repacked in forever.
> 
 Yes - I had finished bisecting, with the build still present.
Show 9 quoted lines
> To really pack things (which can slow things down for old history as
> people said, but on the whole it tends to be a big win due to less
> IO), do
> 
>    git repack -adf --window=200 --depth=200
> 
> and go away for a while. Oh, and make sure your machine has enough
> memory and CPU to make that "for a while" not be *too* long.
> 
 For that, many thanks - this desktop has about 7GB (integrated
graphics steal a bit), current AMD desktop, and the repack of my
scripts repo took about 56 seconds.  I'll do that on my copy of
the kernel tomorrow (it's on another machine).
Show 16 quoted lines
> You should have a few hundred files (just a few tens of files directly
> after the repack) and that roughly 850MB of space for the repository
> information itself.
> 
> But yeah, fully checked out and built with all the modules etc, you
> would have much more.
> 
> That said, if you have something fairly that is consistently really
> slow (like the "git commit" you mentioned), *before* doing the repack,
> do
> 
>    strace -o ../trace-file -Ttt git commit
> 
> and we can get a much better guess about why it's so slow. Send it to
> me in private email if you don't want to make it public, and I can
> take a look.
 I don't think you need to look - it was taking most of the time
(about 8 seconds) looping through the many files below .git/objects.
The trace was just over 9000 lines, repeating after the repack was
less than 1300 lines.  It's available (97K after using xz) if you
think it would be useful, but I think you have already diagnosed the
problem and solution.
Show 7 quoted lines
> 
> > ping between them gives times of 0.25 to 0.3 seconds
> 
> .. and I *really* hope that was not seconds, but ms. Otherwise your
> nfsv3 setup is going to be really really painful.
> 
>                           Linus
 Yes, I'm not always good at knowing the right units.  Thanks for the
help.
ĸen
-- 
Nanny Ogg usually went to bed early. After all, she was an old lady.
Sometimes she went to bed as early as 6 a.m.
Previous: Linus Torvalds
Message 9 of 9 in “Git very slow ?”
  1. Ken MoffatMar 7, 2015
  2. Kevin DMar 8, 2015
  3. David KastrupMar 8, 2015
  4. Ken MoffatMar 8, 2015
  5. David KastrupMar 8, 2015
  6. Linus TorvaldsMar 8, 2015
  7. Ken MoffatMar 8, 2015
  8. Linus TorvaldsMar 8, 2015
  9. Ken MoffatMar 8, 2015

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.