git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Markus Trippelsdorf <markus@trippelsdorf.de>, git@vger.kernel.org
Subject: Re: git pull takes ~8 seconds on up-to-date Linux git tree
Date: Sat, 6 Oct 2012 08:57:35 -0400	[thread overview]
Message-ID: <20121006125735.GA11712@sigill.intra.peff.net> (raw)
In-Reply-To: <7vobkgrxay.fsf@alter.siamese.dyndns.org>

On Fri, Oct 05, 2012 at 10:20:37PM -0700, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> >> > @@ -617,6 +618,8 @@ static struct commit_list *paint_down_to_common(struct commit *one, int n, struc
> >> >  
> >> >  	one->object.flags |= PARENT1;
> >> >  	commit_list_insert_by_date(one, &list);
> >> > +	if (!n)
> >> > +		return list;
> >> >  	for (i = 0; i < n; i++) {
> >> >  		twos[i]->object.flags |= PARENT2;
> >> >  		commit_list_insert_by_date(twos[i], &list);
> >
> > This seems like an obvious optimization, but does it really have
> > anything to do with the patch at hand?
> 
> The function picks one and paints it against all others, but the
> logic assumes there must be at least one other to paint against;
> otherwise the traversal will not ever find a node that is painted
> with both PARENT1 and PARENT2 to stop, leading us to traverse all
> the way down to root.

Ah, OK. I was thinking it was just a way to skip the further logic,
which would come to the same answer (it does, just not quickly). Makes
sense.

-Peff

      reply	other threads:[~2012-10-06 12:57 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-04 14:14 git pull takes ~8 seconds on up-to-date Linux git tree Markus Trippelsdorf
2012-10-04 18:43 ` Jeff King
2012-10-04 19:26   ` Markus Trippelsdorf
2012-10-04 19:36   ` Junio C Hamano
2012-10-04 20:03   ` Junio C Hamano
2012-10-04 20:44     ` Junio C Hamano
2012-10-04 21:16   ` Junio C Hamano
2012-10-04 21:28     ` Junio C Hamano
2012-10-04 22:37       ` Junio C Hamano
2012-10-05 20:34         ` Junio C Hamano
2012-10-05 23:21           ` Jeff King
2012-10-06  5:20             ` Junio C Hamano
2012-10-06 12:57               ` 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

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

  git send-email \
    --in-reply-to=20121006125735.GA11712@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=markus@trippelsdorf.de \
    /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).