git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Cameron <andrew@worksmartlabs.com>
To: git@vger.kernel.org
Subject: Re: git checkout running very slowly (>12s)
Date: Mon, 20 Jun 2011 20:26:37 +0000 (UTC)	[thread overview]
Message-ID: <loom.20110620T221426-685@post.gmane.org> (raw)
In-Reply-To: loom.20110616T010709-333@post.gmane.org

Andrew Cameron <andrew <at> worksmartlabs.com> writes:

> 
> $ git --version
> git version 1.7.0.4
> 

In the interest of leaving a message of hope in the archives for users 
experiencing this same problem, I will record to the list that I managed to 
solve the problem, if not understand it.  As you can see in the transcript 
above, I had been using an older version of git:

> $ git --version
> git version 1.7.0.4

After running sudo apt-get build-dep git-core and then building git from
source, we see this instead:

> $ git --version
> git version 1.7.5.4

And the success story:

$ time git checkout master
Switched to branch 'master'
git checkout master  0.88s user 0.25s system 99% cpu 1.135 total
$ time git checkout -
Switched to branch 'newbranch'
git checkout -  0.87s user 0.25s system 99% cpu 1.121 total

It might be interesting to note that both before and after upgrading git, 
running "strace -c git checkout master" in an attempt to figure out where all my 
time was spent was *not* particularly helpful.  An excerpt from strace's output 
from before the upgrade:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
100.00    0.003499           0     90884         7 lstat64

And another one from afterwards:

% time     seconds  usecs/call     calls    errors syscall
------ ----------- ----------- --------- --------- ----------------
 99.24    0.003276           0     90886         7 lstat64

In other words, it appears that an efficient lstat implementation was not the 
key factor in this problem.  The root cause remains a mystery, but in my case, 
the solution was to upgrade Git.

Thanks for reading.

  reply	other threads:[~2011-06-20 20:26 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-15 19:30 git checkout running very slowly (>12s) Andrew Cameron
2011-06-15 22:46 ` Andreas Ericsson
2011-06-15 23:16   ` Andrew Cameron
2011-06-20 20:26     ` Andrew Cameron [this message]
2011-06-21  0:44       ` Jeff King
2011-06-21 14:34         ` Jeff King
2011-06-21 14:44           ` Andrew Cameron

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=loom.20110620T221426-685@post.gmane.org \
    --to=andrew@worksmartlabs.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).