git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Brian Downing <bdowning@lavos.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Serious performance regression in diff between 1.6.6 and 1.7.0
Date: Wed, 9 Jun 2010 19:10:05 -0500	[thread overview]
Message-ID: <20100610001005.GA2635@glaurung.lavos.net> (raw)

I've stumbled across a pretty serious performance regression in "git
diff" for a large (187456 files checked out on HEAD) repository of mine.

I bisected it and the first slow commit is:
commit 730f72840cc50c523fe4cdd796ea2d2fc4571a28
Author: Junio C Hamano <gitster@pobox.com>
Date:   Sun Sep 20 00:03:39 2009 -0700

    unpack-trees.c: look ahead in the index

    This makes the traversal of index be in sync with the tree traversal.
    When unpack_callback() is fed a set of tree entries from trees, it
    inspects the name of the entry and checks if the an index entry with
    the same name could be hiding behind the current index entry, and

    ...

It is more than 10x worse for my case here:

before 730f72840cc50c523fe4cdd796ea2d2fc4571a28:
:; /usr/bin/time ~/src/git/git-diff HEAD >/dev/null
0.30user 0.50system 0:00.81elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+30119minor)pagefaults 0swaps

730f72840cc50c523fe4cdd796ea2d2fc4571a28:
:; /usr/bin/time ~/src/git/git-diff HEAD >/dev/null
5.58user 0.40system 0:05.98elapsed 100%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+30117minor)pagefaults 0swaps

Unfortunately this pushes everyday use past my pain threshold for this
repository.  (As a sidenote, it's amazing how much Git has adjusted my
pain threshold since the days of CVS!)

Is there any chance of algorithmic improvements to this fix to gain some
of this speed back, or am I stuck with this when using newer Git?

-bcd

             reply	other threads:[~2010-06-10  0:16 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-06-10  0:10 Brian Downing [this message]
2010-06-10 17:08 ` Serious performance regression in diff between 1.6.6 and 1.7.0 Brian Downing
2010-06-10 18:14   ` Brian Downing
2010-06-10 18:42     ` Brian Downing
2010-06-11  2:59     ` [PATCH] unpack-trees: Make index lookahead less pessimal Brian Downing
2010-06-11  4:26       ` Junio C Hamano

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=20100610001005.GA2635@glaurung.lavos.net \
    --to=bdowning@lavos.net \
    --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.
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).