From: Linus Torvalds <torvalds@linux-foundation.org>
To: Julian Phillips <julian@quantumfyre.co.uk>
Cc: git@vger.kernel.org
Subject: Re: Why are ref_lists sorted?
Date: Mon, 19 Mar 2007 10:03:10 -0700 (PDT) [thread overview]
Message-ID: <Pine.LNX.4.64.0703190935360.6730@woody.linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0703190321370.28570@beast.quantumfyre.co.uk>
On Mon, 19 Mar 2007, Julian Phillips wrote:
>
> So my questions are:
>
> 1) what have I broken by removing the sort?
The big thing is probably consistency.
I *really* think we need to sort these things. Otherwise you'll see two
totally identical repositories giving different results to something as
fundamental as "git ls-remote" just because they didn't get sorted.
So I think sorting is absolutely required, perhaps not so much because it
is necessarily "incorrect" without the sorting, but because I think
consistency in this area is too important *not* to sort it.
And sorting it really is simple. The fact that we use a O(n**2) list
insertion thing that is also probably pessimal for the case of "already
sorted" input is just a "hey, it was easy, we never actually hit it in
practice" issue.
> 2) is it worth trying to optimise the sort?
Absolutely. It might involve changing the "ref_list *" thing into an array
of ref_entries, and that will cause a lot of (fairly trivial) changes, but
it should all be entirely internal to refs.c, so it's hopefully not
painful, just some boring grunt-work.
Linus
prev parent reply other threads:[~2007-03-19 17:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-03-19 3:38 Why are ref_lists sorted? Julian Phillips
2007-03-19 4:50 ` Junio C Hamano
2007-03-19 4:54 ` Shawn O. Pearce
2007-03-19 5:22 ` Julian Phillips
2007-03-19 5:33 ` Shawn O. Pearce
2007-03-19 5:42 ` Junio C Hamano
2007-03-19 17:03 ` Linus Torvalds [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=Pine.LNX.4.64.0703190935360.6730@woody.linux-foundation.org \
--to=torvalds@linux-foundation.org \
--cc=git@vger.kernel.org \
--cc=julian@quantumfyre.co.uk \
/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).