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

Re: [PATCH 2/2] index-pack: reduce memory usage when the pack has large blobs

From
IKIan Kumlien <pomac@vapor.com>
Date
Feb 24, 2012, 14:40 UTC
Message-ID
<20120224144052.GF9526@pomac.netswarm.net>
In-Reply-To
<1330086201-13916-2-git-send-email-pclouds@gmail.com>
On Fri, Feb 24, 2012 at 07:23:21PM +0700, Nguyễn Thái Ngọc Duy wrote:
Show 23 quoted lines
> This command unpacks every non-delta objects in order to:
> 
> 1. calculate sha-1
> 2. do byte-to-byte sha-1 collision test if we happen to have objects
>    with the same sha-1
> 3. validate object content in strict mode
> 
> All this requires the entire object to stay in memory, a bad news for
> giant blobs. This patch lowers memory consumption by not saving the
> object in memory whenever possible, calculating SHA-1 while unpacking
> the object.
> 
> This patch assumes that the collision test is rarely needed. The
> collision test will be done later in second pass if necessary, which
> puts the entire object back to memory again (We could even do the
> collision test without putting the entire object back in memory, by
> comparing as we unpack it).
> 
> In strict mode, it always keeps non-blob objects in memory for
> validation (blobs do not need data validation). "--strict --verify"
> also keeps blobs in memory.
> 
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Actually, nevermind my last report - i had missed a merge :(

And now that i merged that part it seems like it doesn't do much.. (No real output for 2+ minutes)

I think i should reapply the patches again and verify that everything is correct before reporting any additional progress.

But, this might not be before monday, unfortunately... But *thanks* for posting the patches!

Previous: Ian KumlienNext: Ian Kumlien
Message 4 of 11 in “Skip SHA-1 collision test on "index-pack --verify"”
  1. 1/2 Skip SHA-1 collision test on "index-pack --verify"Nguyễn Thái Ngọc Duy, Feb 24, 2012
  2. 2/2 index-pack: reduce memory usage when the pack has large blobsNguyễn Thái Ngọc Duy, Feb 24, 2012
  3. Ian KumlienFeb 24, 2012
  4. Ian KumlienFeb 24, 2012
  5. Ian KumlienFeb 24, 2012
  6. Ian KumlienFeb 24, 2012
  7. Nguyen Thai Ngoc DuyFeb 25, 2012
  8. Ian KumlienFeb 25, 2012
  9. Ian KumlienFeb 25, 2012
  10. Nguyen Thai Ngoc DuyFeb 26, 2012
  11. Ian KumlienFeb 26, 2012

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.