Re: git checkout running very slowly (>12s)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Andreas Ericsson <ae <at> op5.se> writes:

> 
> On 06/15/2011 09:30 PM, Andrew Cameron wrote:
> > Some git operations (notably checkouts) are taking a very long time to 
execute.
> > Here is a shell session which illustrates the problem.
> > 
> > $ time git branch foo
> > git branch foo  0.01s user 0.00s system 77% cpu 0.016 total
> 
> Creating a branch is just a matter of creating a new ref. In this
> case, you're doing it on the currently checked out ref. That's a
> constant-time operation that is always very quick.
> 
> > $ time git checkout foo
> > Switched to branch 'foo'
> > git checkout foo  11.73s user 0.18s system 99% cpu 11.937 total
> 
> If this sequence of commands is accurate, that's a bit weird. If
> you've got another branch checked out first and then switch it
> would be understandable, considering the size of the repository.
> We should probably still do a tree-by-tree comparison to see
> which files are changed though, but I thought that's already
> done to avoid superfluous work and allow worktree changes to
> carry over to other branches. What version of git are you using?

I suppose I forgot to illustrate that, when I created "foo" I was on "master".  
The order branch checkouts was master -> foo -> master, and both transitions 
took ~12s despite pointing to the same commit and using a clean working tree.  I 
imagine you inferred all of that, but if not, now you know.

$ git --version
git version 1.7.0.4

> > $ time git checkout master
> > Switched to branch 'master'
> > git checkout master  11.62s user 0.18s system 99% cpu 11.813 total
> > $ git count-objects -v
> > count: 953
> > size: 527012
> > in-pack: 153432
> > packs: 7
> > size-pack: 1986072
> > prune-packable: 0
> > garbage: 0
> > 
> 
> These figures are nowhere near as interesting as those from
>   git ls-files | wc -l
> after the checkout is completed.
> 

$ git checkout master
Switched to branch 'master'
$ git ls-files | wc -l
90831

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]