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

Re: [PATCH] {fetch,receive}-pack: drop unpack-objects, delay loosing objects until the end

From
Eric Sunshine <sunshine@sunshineco.com>
Date
Sep 2, 2013, 04:38 UTC
Message-ID
<CAPig+cTscSov3kHX6Mj_LpK1CeH+x4NTexdWZD42NT-KfohvrA@mail.gmail.com>
In-Reply-To
<1378091107-31682-1-git-send-email-pclouds@gmail.com>
On Sun, Sep 1, 2013 at 11:05 PM, Nguyễn Thái Ngọc Duy <pclouds@gmail.com> wrote:
> Current code peaks into the transfered pack's header, if the number of
s/peaks/peeks/
Show 27 quoted lines
> objects is under a limit, unpack-objects is called to handle the rest,
> otherwise index-pack is. This patch makes fetch-pack use index-pack
> unconditionally, then turn objects loose and remove the pack at the
> end. unpack-objects is deprecated and may be removed in future.
>
> There are a few reasons for this:
>
>  - down to two code paths to maintain regarding pack reading
>    (sha1_file.c and index-pack.c). When .pack v4 comes, we don't need
>    to duplicate work in index-pack and unpack-objects.
>
>  - the number of objects should not be the only indicator for
>    unpacking. If there are a few large objects in the pack, the pack
>    should be kept anyway. Keeping the pack lets us examine the whole
>    pack later and make a better decision.
>
>  - by going through index-pack first, then unpack, we pay extra cost
>    for completing a thin pack into a full one. But compared to fetch's
>    total time, it should not be noticeable because unpack-objects is
>    only called when the pack contains a small number of objects.
>
>  - unpack-objects does not support streaming large blobs. Granted
>    force_object_loose(), which is used by this patch, does not either.
>    But it'll be easier to do so because sha1_file.c interface supports
>    streaming.
>
> Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Previous: Nguyễn Thái Ngọc DuyNext: Jeff King
Message 2 of 12 in “{fetch,receive}-pack: drop unpack-objects, delay loosing objects until the end”
  1. {fetch,receive}-pack: drop unpack-objects, delay loosing objects until the endNguyễn Thái Ngọc Duy, Sep 2, 2013
  2. Eric SunshineSep 2, 2013
  3. Jeff KingSep 3, 2013
  4. Duy NguyenSep 3, 2013
  5. Jeff KingSep 3, 2013
  6. 1/3 index-pack: add --unpack-limit to unpack objectsNguyễn Thái Ngọc Duy, Sep 6, 2013
  7. 2/3 fetch-pack: use index-pack --unpack-limit instead of unpack-objectsNguyễn Thái Ngọc Duy, Sep 6, 2013
  8. Jeff KingSep 8, 2013
  9. 3/3 receive-pack: use index-pack --unpack-limit instead of unpack-objectsNguyễn Thái Ngọc Duy, Sep 6, 2013
  10. Jeff KingSep 8, 2013
  11. Duy NguyenSep 8, 2013
  12. Jeff KingSep 8, 2013

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.