git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Darren Cook <darren@dcook.org>, git@vger.kernel.org
Subject: Re: Bug Report: git add
Date: Fri, 8 Apr 2011 15:46:51 -0400	[thread overview]
Message-ID: <20110408194650.GA15804@sigill.intra.peff.net> (raw)
In-Reply-To: <20110408191554.GA6516@sigill.intra.peff.net>

On Fri, Apr 08, 2011 at 03:15:54PM -0400, Jeff King wrote:

> > This only checks "does the directory have .git in it?".
> 
> Yeah. I was trying to keep the test as inexpensive as possible, since
> this is a very frequently called codepath. But really, doing a more
> elaborate test shouldn't matter. The common case will be that the stat
> fails, and we do nothing else.
> 
> I do worry about adding an extra lstat for each directory having
> noticeable overhead. Maybe it doesn't matter because of the stat
> caching, but I didn't measure.

I just did some measurements on linux-2.6 (which is a fair bit more
directory-heavy than something like git.git). The difference is
measurable, but not significant.

The average for "git add ." (on a clean, warm-cache repository) over
many trials with the extra lstats is about 2-3% slower.  But the error
margin between trials is something like 3-4%. IOW, even though the
average was worse, the best trial for the new code was still faster than
the worst trial for the old.

This is on Linux, though. It would probably be worse on an OS with a
slower stat.

-Peff

      reply	other threads:[~2011-04-08 19:47 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-04-05 23:18 Bug Report: git add Darren Cook
2011-04-06  5:52 ` Ramkumar Ramachandra
2011-04-10  7:48   ` Jakub Narebski
2011-04-10  8:29     ` Ramkumar Ramachandra
2011-04-11 17:55     ` Junio C Hamano
2011-04-11 18:20       ` Jeff King
2011-04-07  0:57 ` Jeff King
2011-04-07  1:09   ` Junio C Hamano
2011-04-07  1:12     ` Jeff King
2011-04-07  1:48     ` Jeff King
2011-04-07  7:28       ` Junio C Hamano
2011-04-08 19:15         ` Jeff King
2011-04-08 19:46           ` Jeff King [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20110408194650.GA15804@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=darren@dcook.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).