git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Speed of git branch --contains
@ 2018-01-23 20:36 Andreas Krey
  2018-01-24 16:20 ` Ævar Arnfjörð Bjarmason
  0 siblings, 1 reply; 2+ messages in thread
From: Andreas Krey @ 2018-01-23 20:36 UTC (permalink / raw)
  To: git

Hi everybody,

I'm just looking at some scripts that do a 'git branch --contains $id --remote'
for each new commit in a repo, and unfortunately each invokation already
takes four minutes.

It feels like git branch does the reachability detection separately
for each branch potentially listed. The alternative would be to

- invert the parent map to a child map,
- use that to compute the set of commits that contain $id,
- then use that as predicate whether to show a given branch
  (show iff its head is in the set)

That would speed things up considerably,
but what are the chances to see that change in git?

I can do that as well within the script, with the additional
benefit that I only need to do the inversion once, but I might
instead take a stab at git branch.

- Andreas

-- 
"Totally trivial. Famous last words."
From: Linus Torvalds <torvalds@*.org>
Date: Fri, 22 Jan 2010 07:29:21 -0800

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-01-24 16:20 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-23 20:36 Speed of git branch --contains Andreas Krey
2018-01-24 16:20 ` Ævar Arnfjörð Bjarmason

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).