git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jay Soffian <jaysoffian@gmail.com>
To: git <git@vger.kernel.org>
Subject: git diff timing oddity
Date: Thu, 6 May 2010 01:04:18 -0400	[thread overview]
Message-ID: <y2j76718491005052204qb6de9c26k58eb1550f1c5346f@mail.gmail.com> (raw)

git version 1.7.1, Mac OS X 10.6.3, largish repo (42K files, 35K
commits, well packed ~ 1GB). Difference between origin and HEAD is a
single commit.

$ time git diff --stat origin  >/dev/null

real	0m0.942s
user	0m0.713s
sys	0m0.223s

$ time git diff --stat origin  >/dev/null

real	0m0.944s
user	0m0.712s
sys	0m0.227s

$ time git diff --stat origin  >/dev/null

real	0m0.944s
user	0m0.712s
sys	0m0.225s

$ time git diff --stat origin HEAD >/dev/null

real	0m0.022s
user	0m0.006s
sys	0m0.012s

$ time git diff --stat origin HEAD >/dev/null

real	0m0.022s
user	0m0.006s
sys	0m0.013s

$ time git diff --stat origin HEAD >/dev/null

real	0m0.023s
user	0m0.006s
sys	0m0.013s

These should be identical commands, so why is the "origin HEAD" form
running an order of magnitude faster?

j.

             reply	other threads:[~2010-05-06  5:04 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-06  5:04 Jay Soffian [this message]
2010-05-06  5:07 ` git diff timing oddity Jay Soffian
2010-05-06  5:08 ` Jeff King

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=y2j76718491005052204qb6de9c26k58eb1550f1c5346f@mail.gmail.com \
    --to=jaysoffian@gmail.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).