From: Junio C Hamano <gitster@pobox.com>
To: Brandon Casey <drafnel@gmail.com>
Cc: Jeff King <peff@peff.net>, Brandon Casey <bcasey@nvidia.com>,
"git\@vger.kernel.org" <git@vger.kernel.org>,
Martin Fick <mfick@codeaurora.org>
Subject: Re: [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list
Date: Wed, 03 Jul 2013 11:40:12 -0700 [thread overview]
Message-ID: <7vhagbfpwz.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <CA+sFfMeDC=hc7QZhfSuQYsdBPzig5WANeTBhMxFZk=Pusq0QpA@mail.gmail.com> (Brandon Casey's message of "Wed, 3 Jul 2013 11:12:10 -0700")
Brandon Casey <drafnel@gmail.com> writes:
> Right. For repos with few refs on either side, I don't think there
> will be any measurable difference. When pushing a single ref to a
> repo with a very large number of refs, we will see a very small net
> loss for the time required to prepare the string list (which grows
> linearly with the number of remote refs). After 2 or 3 refs, we
> should see a net gain.
>
> So we're really just improving our worst case performance here.
... by penalizing the common case by how much? If it is not too
much, then this obviously would be a good change.
> ... But, I don't see a down side to doing the lazy prepare in
> the other loop too, and in fact, it looks like we may be able to avoid
> building the string list when only explicit refspecs are used. So,
> yeah, we should lazy build in both loops.
OK, so will see a reroll sometime?
next prev parent reply other threads:[~2013-07-03 18:40 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-07-02 23:53 [PATCH] remote.c: avoid O(n^2) behavior in match_push_refs by using string_list Brandon Casey
2013-07-03 6:23 ` Jeff King
2013-07-03 18:12 ` Brandon Casey
2013-07-03 18:40 ` Junio C Hamano [this message]
2013-07-03 19:00 ` Jeff King
2013-07-03 20:05 ` Brandon Casey
2013-07-03 19:21 ` Brandon Casey
2013-07-03 20:22 ` Junio C Hamano
2013-07-08 7:02 ` [PATCH v2] remote.c: avoid O(m*n) behavior in match_push_refs Brandon Casey
2013-07-08 7:50 ` Jeff King
2013-07-08 8:58 ` [PATCH v2 w/prune index] " Brandon Casey
2013-07-08 16:12 ` 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
List information: http://vger.kernel.org/majordomo-info.html
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=7vhagbfpwz.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=bcasey@nvidia.com \
--cc=drafnel@gmail.com \
--cc=git@vger.kernel.org \
--cc=mfick@codeaurora.org \
--cc=peff@peff.net \
/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.
Code repositories for project(s) associated with this public inbox
https://80x24.org/mirrors/git.git
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 read-only IMAP folder(s) and NNTP newsgroup(s).