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

Re: [PATCH v2 1/4] commit.c: add clear_commit_marks_many()

From
Jeff King <peff@peff.net>
Date
Mar 6, 2013, 08:30 UTC
Message-ID
<20130306083037.GA2018@sigill.intra.peff.net>
In-Reply-To
<1362523639-30566-2-git-send-email-gitster@pobox.com>
On Tue, Mar 05, 2013 at 02:47:16PM -0800, Junio C Hamano wrote:
> clear_commit_marks(struct commit *, unsigned) only can clear flag
> bits starting from a single commit; introduce an API to allow
> feeding an array of commits, so that flag bits can be cleared from
> commits reachable from any of them with a single traversal.
Out of curiosity, is that actually measurably more efficient?

Since we stop traversing a commit's parents when we see it does not have any of the flags we are clearing, we should visit most commits once. The exception is ones that we hit by multiple paths. But that should be the same whether it is done as part of a single traversal or multiple; in each case, we hit the commit and say "Oh, already cleared; do not add it to the parents list".

So I would expect it to have little to no impact on performance. I still think it is a sane interface change; I was just curious from the commit message whether there could be a performance impact.

-Peff
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 9 in “push --follow-tags”
  1. 0/4 push --follow-tagsJunio C Hamano, Mar 5, 2013
  2. 1/4 commit.c: add clear_commit_marks_many()Junio C Hamano, Mar 5, 2013
  3. Jeff KingMar 6, 2013
  4. Junio C HamanoMar 6, 2013
  5. 2/4 commit.c: add in_merge_bases_many()Junio C Hamano, Mar 5, 2013
  6. 3/4 commit.c: use clear_commit_marks_many() in in_merge_bases_many()Junio C Hamano, Mar 5, 2013
  7. 4/4 push: --follow-tagsJunio C Hamano, Mar 5, 2013
  8. Jeff KingMar 6, 2013
  9. Junio C HamanoMar 6, 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.