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: Pete Wyckoff <pw@padd.com>, git@vger.kernel.org
Subject: Re: [PATCH] convert filter: supply path to external driver
Date: Sun, 19 Dec 2010 21:24:09 -0500	[thread overview]
Message-ID: <20101220022409.GA4625@sigill.intra.peff.net> (raw)
In-Reply-To: <7vzks1e84p.fsf@alter.siamese.dyndns.org>

On Sun, Dec 19, 2010 at 01:59:50PM -0800, Junio C Hamano wrote:

> Modulo one worry.  Don't we have, or don't we at least plant to allow us
> to have, a facility to cache expensive blob conversion result, similar to
> the textconv caching?  How would this change interact with two blobs that
> live in different paths?

Yeah, it has been talked about, but I don't think anyone is working on
it (I don't personally use clean/smudge at all, so it is not something I
have thought _that_ much about).

This does definitely complicate matters, as the filtering is no longer a
pure mapping of sha1->sha1. However, I think in practice we could do
just fine by using a multi-level lookup. I.e., mapping a sha1 to be
filtered into a tree. Each tree entry would represent the remaining
cache parameters. In this case, the only other parameter we have is the
path given to the filter (but it could easily be extended to include
other parameters, if they existed, in this or other caching cases).

We only get a high-performance lookup for the first part of the
multi-level (i.e., the sha1), but that's OK if we assume the number of
second-level items is going to be small. Which I think is the case here
(a sha1 will tend to be found only under one or a few names).

An alternative would be to combine all parts of the filter under a
single lookup key. E.g., calculate and store under sha1(sha1(blob) +
filename)). But that means the notes keys are not actual object sha1s,
which throws off pruning.

Anyway, that's just my quick thinking on the subject. I don't see any
reason to restrict a feature just because we might want to cache it in
the future. At the very worst, we could always cache filters which do
not use %s, and make only %s users pay the penalty.

-Peff

  reply	other threads:[~2010-12-20  2:24 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-18 22:38 smudge/clean filter needs filename Pete Wyckoff
2010-12-19 21:29 ` [PATCH] convert filter: supply path to external driver Pete Wyckoff
2010-12-19 21:59   ` Junio C Hamano
2010-12-20  2:24     ` Jeff King [this message]
2010-12-20  5:52       ` david
2010-12-20 16:09     ` [PATCH v2] " Pete Wyckoff
2010-12-20 17:59       ` Junio C Hamano
2010-12-21 13:44         ` [PATCH v3] " Pete Wyckoff
2010-12-21 18:19           ` Jonathan Nieder
2010-12-21 20:33             ` [PATCH v4] " Pete Wyckoff
2010-12-21 21:24               ` Junio C Hamano
2010-12-22 14:40                 ` [PATCH v5] " Pete Wyckoff
2010-12-22 18:10                   ` Junio C Hamano
2010-12-22 23:22                     ` Junio C Hamano
2010-12-20  8:04   ` [PATCH] " Johannes Sixt
2010-12-20  8:52     ` Junio C Hamano
2010-12-20 14:41     ` Pete Wyckoff

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=20101220022409.GA4625@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=pw@padd.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).