From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: Some git performance measurements..
Date: Fri, 30 Nov 2007 01:54:13 +0100 [thread overview]
Message-ID: <finmvm$da8$1@ger.gmane.org> (raw)
In-Reply-To: alpine.LFD.0.99999.0711291208060.9605@xanadu.home
<opublikowany i wysłany>
[Cc: git@vger.kernel.org, Nicolas Pitre <nico@cam.org>,
Linus Torvalds <torvalds@linux-foundation.org>]
Nicolas Pitre wrote:
> Well, see below for the patch that actually split the pack data into
> objects of the same type. Doing that "git checkout" on the kernel tree
> did improve things for me although not spectacularly.
> +static int sort_by_type(const void *_a, const void *_b)
> +{
> + const struct object_entry *a = *(struct object_entry **)_a;
> + const struct object_entry *b = *(struct object_entry **)_b;
> +
> + /*
> + * Preserve recency order for objects of the same type and reused deltas.
> + */
> + if(a->type == OBJ_REF_DELTA || a->type == OBJ_OFS_DELTA ||
> + b->type == OBJ_REF_DELTA || b->type == OBJ_OFS_DELTA ||
> + a->type == b->type)
> + return (a < b) ? -1 : 1;
> + return a->type - b->type;
> +}
> + qsort(sorted_by_type, nr_objects, sizeof(*sorted_by_type), sort_by_type);
Isn't there a better way to do this sorting? What is needed here is
(stable) _bucket_ sort / _pigeonhole_ sort (or counting sort), which
is O(n); quicksort is perhaps simpler to use, but I'm not sure if
faster in this situation.
--
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git
next prev parent reply other threads:[~2007-11-30 1:00 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-29 2:49 Some git performance measurements Linus Torvalds
2007-11-29 3:14 ` Linus Torvalds
2007-11-29 3:59 ` Nicolas Pitre
2007-11-29 4:32 ` Linus Torvalds
2007-11-29 17:25 ` Nicolas Pitre
2007-11-29 17:48 ` Linus Torvalds
2007-11-29 18:52 ` Nicolas Pitre
2007-11-30 5:00 ` Junio C Hamano
2007-11-30 6:03 ` Linus Torvalds
2007-11-30 0:54 ` Jakub Narebski [this message]
2007-11-30 2:21 ` Linus Torvalds
2007-11-30 2:39 ` Jakub Narebski
2007-11-30 2:40 ` Nicolas Pitre
2007-11-30 6:11 ` Steffen Prohaska
2007-12-07 13:35 ` Mike Ralphson
2007-12-07 13:49 ` Johannes Schindelin
2007-12-07 16:07 ` Linus Torvalds
2007-12-07 16:09 ` Mike Ralphson
2007-12-07 18:37 ` Johannes Schindelin
2007-12-07 19:15 ` Mike Ralphson
2007-12-08 11:05 ` Johannes Schindelin
2007-12-08 23:04 ` Brian Downing
2007-11-30 2:54 ` Linus Torvalds
2007-12-05 1:04 ` Federico Mena Quintero
2007-12-01 11:36 ` Joachim B Haga
2007-12-01 17:19 ` Linus Torvalds
2007-11-29 5:17 ` Junio C Hamano
2007-11-29 10:17 ` [PATCH] per-directory-exclude: lazily read .gitignore files 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='finmvm$da8$1@ger.gmane.org' \
--to=jnareb@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).