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

Re: in_merge_bases() is too expensive for recent "pu" update

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 24, 2012, 16:15 UTC
Message-ID
<7vobm01d1f.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120824151511.GB15162@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 7 quoted lines
> I thought you were just interested in speeding up is_descendent_of. You
> should be able to do that without a generation number. Just start from A
> and B as above, do the two-color painting, and do not add the parents of
> any two-color commits (because you know they are ancestors of both, and
> therefore you cannot find either by looking backwards). If you paint "B"
> amber, then it is a descendent of "A" (and vice versa if you paint "A"
> blue).

Yes, that is what merge_bases_many() (the one without the post processing to cull candidates) is primarily doing. The function also does the "STALE" bit processing that aims to reduce the number of candidates in "no clock skew" cases with minimum effort, to mimimize the cost of get_merge_bases_many() in the post-processing phase, but removing the "STALE" bit processing shouldn't affect the correctness of get_merge_bases_many() and would help performance of merge_bases_many() proper, which is useful for is_descendant_of().

Show 6 quoted lines
> The reason I did not do that for "tag --contains" is that I wanted to
> do a simultaneous walk for all tags. That would require N color bits for
> N tags, and we have a limited space in each commit object. I didn't time
> using a separate hash table to store those bits outside of the commit
> objects. That would have a higher constant, but should still yield good
> big-O complexity.

It may not be a bad idea to at least try and see the performance implications of moving many users of object->flags to a new implementation of per-purpose flag bits based on the decoration infrastracture.

Previous: Jeff KingNext: Junio C Hamano
Message 10 of 16 in “in_merge_bases() is too expensive for recent "pu" update”
  1. Nguyen Thai Ngoc DuyAug 23, 2012
  2. Thomas RastAug 23, 2012
  3. Junio C HamanoAug 23, 2012
  4. Junio C HamanoAug 23, 2012
  5. Junio C HamanoAug 23, 2012
  6. Thomas RastAug 24, 2012
  7. Junio C HamanoAug 24, 2012
  8. Thomas RastAug 24, 2012
  9. Jeff KingAug 24, 2012
  10. Junio C HamanoAug 24, 2012
  11. Junio C HamanoAug 24, 2012
  12. Nguyen Thai Ngoc DuyAug 24, 2012
  13. Nguyen Thai Ngoc DuyAug 24, 2012
  14. Junio C HamanoAug 28, 2012
  15. Thomas RastAug 28, 2012
  16. Junio C HamanoAug 28, 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.