git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] convert: avoid malloc of original file size

From
Jeff King <peff@peff.net>
Date
Mar 8, 2019, 02:52 UTC
Message-ID
<20190308025237.GA12304@sigill.intra.peff.net>
In-Reply-To
<xmqqa7i6kvgf.fsf@gitster-ct.c.googlers.com>
On Fri, Mar 08, 2019 at 10:26:24AM +0900, Junio C Hamano wrote:
Show 12 quoted lines
> 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
Previous: Junio C Hamano
Message 3 of 3 in “convert: avoid malloc of original file size”
  1. convert: avoid malloc of original file sizeJeff King, Mar 7, 2019
  2. Junio C HamanoMar 8, 2019
  3. Jeff KingMar 8, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.