From: Jakub Narebski <jnareb@gmail.com>
To: Drew Northup <drew.northup@maine.edu>
Cc: Michael Haggerty <mhagger@alum.mit.edu>,
Jeff King <peff@peff.net>, Junio C Hamano <gitster@pobox.com>,
git@vger.kernel.org
Subject: Re: Strange O(N^3) behavior in "git filter-branch"
Date: Mon, 18 Jul 2011 01:59:19 -0700 (PDT) [thread overview]
Message-ID: <m3pql8yngt.fsf@localhost.localdomain> (raw)
In-Reply-To: <1310909091.21563.23.camel@drew-northup.unet.maine.edu>
Drew Northup <drew.northup@maine.edu> writes:
> On Sat, 2011-07-16 at 07:26 +0200, Michael Haggerty wrote:
>
> > Currently, the loose ref cache is stored as a single linked list, so
> > there is no easy way to populate part of it now and part of it later.
> > So with the current data structure, the loose refs cache is
> > all-or-nothing. It would be possible to avoid filling it if there are
> > not replace references, but if there is even one loose replace reference
> > then the whole refs tree would have to be crawled. Implementing this
> > variation is alternative 4 from the early email.
> >
> > More flexible would be to change the way the loose ref cache is stored
> > from a linked list into a tree (probably mirroring the directory tree).
>
> Given the potential for high performance inherent with trees, why mix
> metaphors like this? What would the gain be?
Did you mean: "why linked list"? I _guess_ that it is most probably
because linked list is simpler and better known data structure than
non-binary tree.
What is needed I think is something like trie[1], but with path
components and not letters stored in trie nodes.
[1]: http://en.wikipedia.org/wiki/Trie
> > If this were done, then it would be possible to populate the cache
> > lazily, only crawling the part of the refs tree that is needed for a
> > particular call of for_each_ref() and reusing any part of the cache that
> > is already in memory.
>
> Is this the argument for directory structure mirroring?
--
Jakub Narębski
next prev parent reply other threads:[~2011-07-18 9:04 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-07-14 7:16 Strange O(N^3) behavior in "git filter-branch" Michael Haggerty
2011-07-14 9:24 ` Michael Haggerty
2011-07-15 9:19 ` Michael Haggerty
2011-07-15 18:51 ` Junio C Hamano
2011-07-15 21:20 ` Jeff King
2011-07-16 5:26 ` Michael Haggerty
2011-07-17 13:24 ` Drew Northup
2011-07-18 8:59 ` Jakub Narebski [this message]
2011-07-18 16:01 ` Drew Northup
2011-08-03 13:33 ` Michael Haggerty
2011-08-03 19:37 ` Jeff King
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=m3pql8yngt.fsf@localhost.localdomain \
--to=jnareb@gmail.com \
--cc=drew.northup@maine.edu \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=mhagger@alum.mit.edu \
--cc=peff@peff.net \
/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).