git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH v2 1/4] commit.c: add clear_commit_marks_many()
Date: Wed, 6 Mar 2013 03:30:38 -0500	[thread overview]
Message-ID: <20130306083037.GA2018@sigill.intra.peff.net> (raw)
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

  reply	other threads:[~2013-03-06  8:31 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-05 22:47 [PATCH v2 0/4] push --follow-tags Junio C Hamano
2013-03-05 22:47 ` [PATCH v2 1/4] commit.c: add clear_commit_marks_many() Junio C Hamano
2013-03-06  8:30   ` Jeff King [this message]
2013-03-06 15:30     ` Junio C Hamano
2013-03-05 22:47 ` [PATCH v2 2/4] commit.c: add in_merge_bases_many() Junio C Hamano
2013-03-05 22:47 ` [PATCH v2 3/4] commit.c: use clear_commit_marks_many() in in_merge_bases_many() Junio C Hamano
2013-03-05 22:47 ` [PATCH v2 4/4] push: --follow-tags Junio C Hamano
2013-03-06  8:41 ` [PATCH v2 0/4] push --follow-tags Jeff King
2013-03-06 15:55   ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130306083037.GA2018@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).