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: "René Scharfe" <rene.scharfe@lsrfire.ath.cx>, git@vger.kernel.org
Subject: Re: rs/commit-list-sort-in-batch
Date: Sat, 7 Apr 2012 03:32:32 -0400	[thread overview]
Message-ID: <20120407073232.GA13076@sigill.intra.peff.net> (raw)
In-Reply-To: <20120407072724.GA818@sigill.intra.peff.net>

On Sat, Apr 07, 2012 at 03:27:24AM -0400, Jeff King wrote:

> On Fri, Apr 06, 2012 at 02:02:56PM -0700, Junio C Hamano wrote:
> 
> > * rs/commit-list-sort-in-batch (2012-04-02) 3 commits
> >  - revision: insert unsorted, then sort in prepare_revision_walk()
> >  - commit: use mergesort() in commit_list_sort_by_date()
> >  - add mergesort() for linked lists
> 
> Looks like you applied these patches right on v1.7.9. However, they need
> Thomas's 5e8617f to compile, which comes later. There's no textual
> conflict, but test-mergesort.c need strbuf_getwholeline_fd, which is
> made public by 5e8617f.

By the way, building on top of René's patches[1], I was able to drop the
time of a particular fetch into a repository with many refs from:

    real    0m2.081s
    user    0m2.180s
    sys     0m0.712s

to:

    real    0m1.784s
    user    0m1.936s
    sys     0m0.652s

with this patch:

diff --git a/builtin/fetch-pack.c b/builtin/fetch-pack.c
index 7124c4b..5d80e65 100644
--- a/builtin/fetch-pack.c
+++ b/builtin/fetch-pack.c
@@ -503,7 +503,7 @@ static int mark_complete(const char *refname, const unsigned char *sha1, int fla
 		struct commit *commit = (struct commit *)o;
 		if (!(commit->object.flags & COMPLETE)) {
 			commit->object.flags |= COMPLETE;
-			commit_list_insert_by_date(commit, &complete);
+			commit_list_insert(commit, &complete);
 		}
 	}
 	return 0;
@@ -615,6 +615,7 @@ static int everything_local(struct ref **refs, int nr_match, char **match)
 	if (!args.depth) {
 		for_each_ref(mark_complete, NULL);
 		for_each_alternate_ref(mark_alternate_complete, NULL);
+		commit_list_sort_by_date(&complete);
 		if (cutoff)
 			mark_recent_complete_commits(cutoff);
 	}

I'm not sure if that vindicates the patches, or implies that these
things are lurking everywhere and that we should really move to a better
data structure so we don't have to fix them all manually. :)

-Peff

[1] Actually, it was René's patches merged into v1.7.10. My ccdc603
    (parse_object: try internal cache before reading object db,
    2012-01-05) makes such a huge difference it is not worth timing
    without it.

  reply	other threads:[~2012-04-07  7:32 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-06 21:02 What's cooking in git.git (Apr 2012, #03; Fri, 6) Junio C Hamano
2012-04-07  7:27 ` rs/commit-list-sort-in-batch Jeff King
2012-04-07  7:32   ` Jeff King [this message]
2012-04-09 19:46     ` rs/commit-list-sort-in-batch 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=20120407073232.GA13076@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=rene.scharfe@lsrfire.ath.cx \
    /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).