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

Re: [PATCH 1/2] index-pack: smarter memory usage when resolving deltas

From
Nicolas Pitre <nico@fluxnic.net>
Date
Apr 12, 2010, 15:45 UTC
Message-ID
<alpine.LFD.2.00.1004121141480.7232@xanadu.home>
In-Reply-To
<4BC2BE09.7060809@viscovery.net>
On Mon, 12 Apr 2010, Johannes Sixt wrote:
Show 14 quoted lines
> Am 4/12/2010 4:57, schrieb Nicolas Pitre:
> > --- a/builtin/index-pack.c
> > +++ b/builtin/index-pack.c
> > @@ -359,34 +359,33 @@ static void *get_data_from_pack(struct object_entry *obj)
> >  {
> >  	off_t from = obj[0].idx.offset + obj[0].hdr_size;
> >  	unsigned long len = obj[1].idx.offset - from;
> > -	unsigned long rdy = 0;
> > -	unsigned char *src, *data;
> > +	unsigned char *data, inbuf[4096];
> 
> With this tiny buffer we make way more pread() calls than we used to,
> right? This hurts emulated pread(), where we do at least 4 syscalls per
> pread(). Shouldn't the buffer be much larger, like min(len,16*4096)?

Well, that is certainly a good compromize. The buffer would need to be malloc()'d and free()'d again though.

Nicolas
Previous: Johannes Sixt
Message 6 of 6 in “index-pack: smarter memory usage when resolving deltas”
  1. 1/2 index-pack: smarter memory usage when resolving deltasNicolas Pitre, Apr 12, 2010
  2. 2/2 index-pack: rationalize unpack_entry_data()Nicolas Pitre, Apr 12, 2010
  3. Johannes SixtApr 12, 2010
  4. Nicolas PitreApr 12, 2010
  5. Johannes SixtApr 12, 2010
  6. Nicolas PitreApr 12, 2010

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.