git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Joey Hess <id@joeyh.name>
Subject: Re: [PATCH] convert: avoid malloc of original file size
Date: Thu, 7 Mar 2019 21:52:37 -0500	[thread overview]
Message-ID: <20190308025237.GA12304@sigill.intra.peff.net> (raw)
In-Reply-To: <xmqqa7i6kvgf.fsf@gitster-ct.c.googlers.com>

On Fri, Mar 08, 2019 at 10:26:24AM +0900, Junio C Hamano wrote:

> Jeff King <peff@peff.net> writes:
> 
> > As discussed there, I do think this only solves half the problem, as the
> > smudge filter has the same issue in reverse. That's more complicated to
> > fix, and AFAIK nobody is working on it. But I don't think there's any
> > reason not to pick up this part in the meantime.
> 
> Yeah, I agree that the reverse direction shares the same issue.
> 
> I am not sure 0 is a good initial value in this direction, either;
> I'd rather clip to min(len, core.bigfilethreshold) or something like
> that, to avoid regressing the more normal use cases.

That was my initial thought, too, but Joey's benchmarks show that it
doesn't seem to make a big difference either way. In his numbers it did
get measurable for a 1GB file, but we'd still not use "hint == len" in
that case (we'd probably do one or two doublings to get there).

I also think running a real (non-condensing) filter on a 1GB file is
already a pretty unlikely corner case.

> But let's queue this and see what happens.

Sounds good to me.

-Peff

      reply	other threads:[~2019-03-08  2:52 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-03-07 19:56 [PATCH] convert: avoid malloc of original file size Jeff King
2019-03-08  1:26 ` Junio C Hamano
2019-03-08  2:52   ` Jeff King [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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190308025237.GA12304@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=id@joeyh.name \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).