From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: "git\@vger.kernel.org" <git@vger.kernel.org>,
Jens Lehmann <Jens.Lehmann@web.de>
Subject: Re: [PATCH 1/2] submodule--helper: initial clone learns retry logic
Date: Thu, 09 Jun 2016 12:59:08 -0700 [thread overview]
Message-ID: <xmqqtwh2gmlv.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kbpurbwAB4H5_JPMsaGHmbeZA=EWjMOfQGB6apLhEXVeA@mail.gmail.com> (Stefan Beller's message of "Thu, 9 Jun 2016 12:47:40 -0700")
Stefan Beller <sbeller@google.com> writes:
> instead. But that is still unspecified, so we rather go with
>
> static int compare_ce(const void *one, const void *two, void *cb_data)
> {
> const struct cache_entry *ce_one = one, *ce_two = two;
> return strcmp(ce_one->name, ce_two->name);
> }
As I said below, I do not think it is worth addressing by making the
code's behaviour on real systems worse. As long as what you have as
the key into priority queue is a pointer to cache_entry, you cannot
make it better from that point of view.
>> I think we have one or two other instances of such fishy pointer
>> comparison already in the codebase, so it is not a show-stopper, but
>> it would be better if this can be avoided and be replaced with
>> something that I do not have to raise eyebrows at ;-)
If you are using priority queue, it probably would make more sense
to use the "priority" part properly---the paths whose ce happens to
be lower in the address space are not inherently more important and
deserve to be processed sooner. From "let's retry failed ones after
finishing", I expected that the queue was either fifo (simplest), or
a prio queue whose priority function would give lower priority for
entries with least number of previous attempts (more involved but
probably more fair).
So a proper "fix" probably is either (1) not to use prio queue as
you are not doing anything with priority anyway, or (2) use
something other than ce itself as entries in prio queue, so that the
priority function can be computation that is more meaningful than
"happens to sit in the lower part of the address space".
next prev parent reply other threads:[~2016-06-09 19:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-09 19:06 [PATCH 0/2] Dealing with a lot of submodules Stefan Beller
2016-06-09 19:06 ` [PATCH 1/2] submodule--helper: initial clone learns retry logic Stefan Beller
2016-06-09 19:19 ` Junio C Hamano
2016-06-09 19:47 ` Stefan Beller
2016-06-09 19:59 ` Junio C Hamano [this message]
2016-06-09 20:40 ` Junio C Hamano
2016-06-09 23:38 ` Stefan Beller
2016-06-09 19:06 ` [PATCH 2/2] submodule update: continue when a clone fails Stefan Beller
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=xmqqtwh2gmlv.fsf@gitster.mtv.corp.google.com \
--to=gitster@pobox.com \
--cc=Jens.Lehmann@web.de \
--cc=git@vger.kernel.org \
--cc=sbeller@google.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.