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

Re: [PATCH] revision: introduce prepare_revision_walk_extended()

From
René Scharfe <l.s.r@web.de>
Date
Dec 25, 2017, 17:36 UTC
Message-ID
<7cb39d8a-2ef2-b7eb-d0cd-6931b2fda951@web.de>
In-Reply-To
<20171224142246.GA23648@sigill.intra.peff.net>
Am 24.12.2017 um 15:22 schrieb Jeff King:
> The single-traversal thing I suspect doesn't matter much in practice. In
> both cases if we would visit commit X twice, we'd immediately see on the
> second visit that it has already been cleared and not do anymore work.

Good point. That makes clear_commit_marks_many() less useful than advertised in e895cb5135, though.

Show 14 quoted lines
>    Side note: Another question is whether it would simply be faster to
>    clear the flags for _all_ objects that we've touched in the current
>    process (we have clear_object_flags() for this already). Then we know
>    that we touch each one once, and we as a bonus we don't even have to
>    keep the previous tips. The downsides are:
> 
>      - if another traversal in the process looked at many objects, but
>        our current traversal looked at few, then we would examine more
>        objects than we need to (albeit with lower cost per object)
> 
>      - it's possible there's another traversal in the same process whose
>        flags we would want to have saved. I suspect such a setup is
>        broken already, though, unless there's a guarantee that the two
>        traversals don't overlap.

I thought about that nuclear option as well. It might be a good idea for code in cmd_* and similar leaf functions for cleaning up between unrelated stages (e.g. between parts that had been separate external git command calls before). They probably only load potentially interesting objects into memory and don't need to bother much about interactions with other functions.

But clear_object_flags() makes me nervous because it clears the flags of all kinds of objects, not just for commits, and I can't easily convince myself that this is safe. Adding a version that checks the object type would be an easy way out.

René
Previous: Jeff KingNext: René Scharfe
Message 10 of 32 in “revision: introduce prepare_revision_walk_extended()”
  1. revision: introduce prepare_revision_walk_extended()René Scharfe, Dec 16, 2017
  2. Martin ÅgrenDec 17, 2017
  3. Jeff KingDec 18, 2017
  4. René ScharfeDec 18, 2017
  5. Jeff KingDec 19, 2017
  6. Junio C HamanoDec 19, 2017
  7. Jeff KingDec 20, 2017
  8. René ScharfeDec 21, 2017
  9. Jeff KingDec 24, 2017
  10. René ScharfeDec 25, 2017
  11. 0/9 revision: get rid of the flag leak_pendingRené Scharfe, Dec 25, 2017
  12. 1/9 commit: avoid allocation in clear_commit_marks_many()René Scharfe, Dec 25, 2017
  13. Jeff KingJan 10, 2018
  14. 2/9 commit: use clear_commit_marks_many() in remove_redundant()René Scharfe, Dec 25, 2017
  15. 3/9 ref-filter: use clear_commit_marks_many() in do_merge_filter()René Scharfe, Dec 25, 2017
  16. 4/9 object: add clear_commit_marks_all()René Scharfe, Dec 25, 2017
  17. Jeff KingJan 10, 2018
  18. René ScharfeJan 11, 2018
  19. Jeff KingJan 12, 2018
  20. 5/9 bisect: avoid using the rev_info flag leak_pendingRené Scharfe, Dec 25, 2017
  21. Jeff KingJan 10, 2018
  22. René ScharfeJan 11, 2018
  23. Jeff KingJan 12, 2018
  24. 6/9 bundle: avoid using the rev_info flag leak_pendingRené Scharfe, Dec 25, 2017
  25. Junio C HamanoDec 28, 2017
  26. Jeff KingJan 10, 2018
  27. 7/9 checkout: avoid using the rev_info flag leak_pendingRené Scharfe, Dec 25, 2017
  28. Junio C HamanoDec 28, 2017
  29. 8/9 revision: remove the unused flag leak_pendingRené Scharfe, Dec 25, 2017
  30. 9/9 commit: remove unused function clear_commit_marks_for_object_array()René Scharfe, Dec 25, 2017
  31. Junio C HamanoDec 28, 2017
  32. Jeff KingJan 10, 2018

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.