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

Re: [PATCH 5/5] (BROKEN) get_merge_bases_many(): walk from many tips in parallel

From
Jeff King <peff@peff.net>
Date
Aug 29, 2012, 11:08 UTC
Message-ID
<20120829110812.GA14069@sigill.intra.peff.net>
In-Reply-To
<7vvcg2y4bk.fsf@alter.siamese.dyndns.org>
On Tue, Aug 28, 2012 at 04:39:11PM -0700, Junio C Hamano wrote:
Show 19 quoted lines
> > git rev-list --committer=torvalds@linux-foundation.org \
> >     --max-parents=2 --min-parents=2 --parents v3.5..v3.6-rc2 >RL
> >
> > cmd='
> > 	while read result parent1 parent2
> > 	do
> > 		$GIT merge-base $parent1 $parent2
> > 	done <RL
> > '
> 
> I have this suspicion that it is spending most of its time in
> insert-by-date.  Luckily, merge_bases_many() is totally outside of
> the usual revision traversal and its use of the commit list is
> pretty well isolated.
> 
> Peff, can I interest you into resurrecting your $gmane/174007 and
> $gmane/174008 (we do not need pop_commit_from_queue() in the latter;
> everything can stay as static to commit.c for now) to see how well
> priority queue based approach would perform?

I did a quick port of merge_bases_many and get_merge_bases_many to use priority queues, but I didn't see any speedup at all on the above test case. According to perf, we spend most of our time in zlib, inflating commits. Only 1% is spent on commit_list_insert_by_date, which is about the same amount spent on queue insertion after my patches.

Patches follow, just for reference.
  [1/2]: basic priority queue implementation
  [2/2]: commit: use a priority queue in merge base functions
-Peff
Previous: Junio C HamanoNext: Jeff King
Message 10 of 27 in “optimize fast-forward checks”
  1. 0/5 optimize fast-forward checksJunio C Hamano, Aug 27, 2012
  2. 1/5 in_merge_bases(): support only one "other" commitJunio C Hamano, Aug 27, 2012
  3. 2/5 receive-pack: use in_merge_bases() for fast-forward checkJunio C Hamano, Aug 27, 2012
  4. 3/5 http-push: use in_merge_bases() for fast-forward checkJunio C Hamano, Aug 27, 2012
  5. 4/5 in_merge_bases(): omit unnecessary redundant common ancestor reductionJunio C Hamano, Aug 27, 2012
  6. 5/5 (BROKEN) get_merge_bases_many(): walk from many tips in parallelJunio C Hamano, Aug 27, 2012
  7. Junio C HamanoAug 28, 2012
  8. Junio C HamanoAug 28, 2012
  9. Junio C HamanoAug 28, 2012
  10. Jeff KingAug 29, 2012
  11. 1/2 basic priority queue implementationJeff King, Aug 29, 2012
  12. 2/2 commit: use a priority queue in merge base functionsJeff King, Aug 29, 2012
  13. Junio C HamanoAug 29, 2012
  14. Jeff KingAug 29, 2012
  15. Jeff KingAug 29, 2012
  16. Jeff KingAug 29, 2012
  17. Jeff KingAug 29, 2012
  18. Jeff KingAug 30, 2012
  19. Jeff KingAug 30, 2012
  20. Jeff KingAug 30, 2012
  21. Junio C HamanoAug 30, 2012
  22. Jeff KingAug 30, 2012
  23. Junio C HamanoAug 30, 2012
  24. Junio C HamanoAug 30, 2012
  25. Jeff KingAug 30, 2012
  26. Junio C HamanoAug 30, 2012
  27. Junio C HamanoAug 29, 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.