From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH 0/3] Using a bit more decoration
Date: Tue, 9 Apr 2013 00:39:39 -0400 [thread overview]
Message-ID: <20130409043938.GA31447@sigill.intra.peff.net> (raw)
In-Reply-To: <7vsj30tk0p.fsf@alter.siamese.dyndns.org>
On Mon, Apr 08, 2013 at 09:17:42PM -0700, Junio C Hamano wrote:
> Jeff King <peff@peff.net> writes:
>
> > [1] The thing that made me think about this was making a version of
> > paint_down_to_common that could keep a separate color for each
> > source, rather than only PARENT1 and PARENT2. That would let us do
> > the "--contains" traversal in a breadth-first way, but calculate the
> > answer simultaneously for all sources (i.e., avoid the depth-first
> > "go to roots" problem that the current "tag --contains" has if you
> > do not use timestamp cutoffs).
>
> Yes, show-branch operates independently of rev-list machinery, hence
> can use full set of bits, but the full set of bits in a word is not
> always sufficient and it can be helped greatly with such an unbound
> set of bits machinery.
The tricky part is how to store the index for each commit (or object). I
don't see a way around adding a new field to "struct commit" to do so.
It _might_ be worth it, because that index would be reusable for many
different operations.
I had hoped to do something clever and implicit with the commit pointer,
since we allocate from a pool. For example, if you have pointer X and
know that the pool starts at Y, you can get an index with simple
subtraction. But of course we don't know what the pool is for any given
allocator without searching the pools, which grow linearly with the
number of objects. So it ends up with the same algorithmic complexity as
just searching for the commit in a data structure (albeit with a smaller
constant, since we allocate big chunks of objects).
-Peff
next prev parent reply other threads:[~2013-04-09 4:39 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-04-08 6:14 [PATCH 2/2] decorate: add "clear_decoration()" Junio C Hamano
2013-04-08 21:09 ` Jeff King
2013-04-08 21:22 ` Junio C Hamano
2013-04-08 23:01 ` [PATCH 0/3] Using a bit more decoration Junio C Hamano
2013-04-08 23:01 ` [PATCH 1/3] commit: shrink "indegree" field Junio C Hamano
2013-04-09 3:52 ` Jeff King
2013-04-08 23:01 ` [PATCH 2/3] commit: rename parse_commit_date() Junio C Hamano
2013-04-08 23:01 ` [PATCH 3/3] commit: add get_commit_encoding() Junio C Hamano
2013-04-09 3:51 ` [PATCH 0/3] Using a bit more decoration Jeff King
2013-04-09 4:17 ` Junio C Hamano
2013-04-09 4:39 ` Jeff King [this message]
2013-04-09 4:54 ` Junio C Hamano
2013-04-09 6:52 ` Jeff King
2013-04-09 20:06 ` Junio C Hamano
2013-04-09 4:37 ` 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=20130409043938.GA31447@sigill.intra.peff.net \
--to=peff@peff.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).