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

Re: [PATCH v2 3/3] index-pack: eliminate unlimited recursion in get_delta_base()

From
Nguyen Thai Ngoc Duy <pclouds@gmail.com>
Date
Jan 10, 2012, 13:03 UTC
Message-ID
<CACsJy8A-FOpjDeTpxMze7jouceWMJHND_V2fyV5pLNKF8xp8kQ@mail.gmail.com>
In-Reply-To
<7vvcokcwvt.fsf@alter.siamese.dyndns.org>
2012/1/10 Junio C Hamano <gitster@pobox.com>:
Show 13 quoted lines
> In parse_pack_objects(), we have two passes. The first pass scans to
> enumerate the objects that appear in the pack and sift them into base and
> delta objects, and the second one starts from a base object, resolves its
> immediate children with find_unresolved_daltas(), but that function recurses
> many times, bound only by the number of objects in the pack, which is the
> issue you are trying to address with this series.
>
> I wonder if a cleaner approach is to change the loop in the second pass in
> such a way that (1) the function it calls resolves _only_ the immediate
> children of the object we know its final shape (either because the object
> was recorded in the deflated form in the pack, or we have already resolved
> it in earlier iteration), and (2) the loop goes over the objects[] array
> not just once, but until we stopped making progress.
So basically:
 - remove the recursion code from get_base_data()
 - update find_unresolved_deltas() to mark resolved objects handled
 - put find_unresolve_deltas() call into a loop to go through all
unhandled objects
correct? Yeah I think it's simpler than current code.
Show 5 quoted lines
> It would require us to be able to tell, by looking at objects[i], if the
> object itself has already been handled (perhaps you can look at its
> idx.sha1 field for this purpose) and if we have already handled its
> immediate delta children (you may need to add a bit to struct object_entry
> for this).
-- 
Duy
Previous: Junio C HamanoNext: Nguyen Thai Ngoc Duy
Message 20 of 21 in “Eliminate recursion in setting/clearing marks in commit list”
  1. 1/3 Eliminate recursion in setting/clearing marks in commit listNguyễn Thái Ngọc Duy, Dec 26, 2011
  2. 2/3 index-pack: eliminate recursion in find_unresolved_deltasNguyễn Thái Ngọc Duy, Dec 26, 2011
  3. 3/3 index-pack: eliminate unlimited recursion in get_delta_base()Nguyễn Thái Ngọc Duy, Dec 26, 2011
  4. 0/3 nd/index-pack-no-recurseNguyễn Thái Ngọc Duy, Jan 9, 2012
  5. Junio C HamanoJan 9, 2012
  6. 0/3 nd/index-pack-no-recurseNguyễn Thái Ngọc Duy, Jan 14, 2012
  7. 1/3 Eliminate recursion in setting/clearing marks in commit listNguyễn Thái Ngọc Duy, Jan 14, 2012
  8. Peter BaumannJan 14, 2012
  9. Nguyen Thai Ngoc DuyJan 15, 2012
  10. 2/3 index-pack: eliminate recursion in find_unresolved_deltasNguyễn Thái Ngọc Duy, Jan 14, 2012
  11. 3/3 index-pack: eliminate unlimited recursion in get_base_data()Nguyễn Thái Ngọc Duy, Jan 14, 2012
  12. 1/3 Eliminate recursion in setting/clearing marks in commit listNguyễn Thái Ngọc Duy, Jan 9, 2012
  13. Junio C HamanoJan 9, 2012
  14. 2/3 index-pack: eliminate recursion in find_unresolved_deltasNguyễn Thái Ngọc Duy, Jan 9, 2012
  15. Junio C HamanoJan 9, 2012
  16. Nguyen Thai Ngoc DuyJan 10, 2012
  17. Junio C HamanoJan 12, 2012
  18. 3/3 index-pack: eliminate unlimited recursion in get_delta_base()Nguyễn Thái Ngọc Duy, Jan 9, 2012
  19. Junio C HamanoJan 9, 2012
  20. Nguyen Thai Ngoc DuyJan 10, 2012
  21. Nguyen Thai Ngoc DuyJan 10, 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.