From: Jonathan Nieder <jrnieder@gmail.com>
To: Jeff King <peff@peff.net>
Cc: Stefan Beller <sbeller@google.com>,
gitster@pobox.com, git@vger.kernel.org
Subject: Re: [PATCH] revision.c: Remove unneeded check for NULL
Date: Tue, 30 Jun 2015 15:48:14 -0700 [thread overview]
Message-ID: <20150630224814.GB4865@google.com> (raw)
In-Reply-To: <20150627060710.GA9353@peff.net>
Jeff King wrote:
> On Fri, Jun 26, 2015 at 12:40:19PM -0700, Stefan Beller wrote:
>>> This code seems to be underdocumented.
>>
>> I am not a expert in this area of the code, so I hoped Peff
>> would document it if he feels like so.
>
> I kind of thought that the explanation in b6e8a3b covered this code.
> Does it not, or did people not read it?
I know that "tl;dr" is the last thing anyone who has written a clear
description of something wants to read, but I fear it applies here. I
tried to skim that commit message to get a gist of what the
still_interesting variable is supposed to hold and I failed.
I think part of the problem was that that commit message doesn't give
a specific example early on to motivate the problem and fix[*].
More to the point, someone interested in that specific variable
doesn't need to necessarily understand the optimization that motivated
it. Instead, they'd want to know what invariants to expect and
preserve: what value does it start with, what does its value mean, are
there some forbidden values, etc.
Is the idea that it represents a commit from the queue which is still
interesting, and that it saves us from looping through the queue to
find a still-interesting commit as long as mark_parents_uninteresting
has not marked this one uninteresting yet? What does it mean when it
is NULL?
Thanks,
Jonathan
[*] I.e., what command do I run to get quadratic behavior?
The message starts with a diagnosis --- "When we are limiting a
rev-list traversal due to UNINTERESTING refs, we have to walk down the
tips" --- without introducing what problem is being diganosed.
The problem being solved might have been something like "When we call
'git rev-list $commits --not --all' in check_everything_connected
after a fetch, if we fetched something much older than most of our
refs, and if we have a large number of refs, the operation is slow ---
quadratic in the number of refs. This hasn't been a problem in the
past because people did not use so many refs, but now as the number of
refs in a typical repository grows, it is becoming more noticeable."
Even after re-reading the message more carefully, I'm not sure. I
assume there was a report motivating the change, which might have been
useful for putting the explanation in context for the reader.
Alas, git://repo.or.cz/git/trast.git branch notes/gmane doesn't have any
annotations for that commit to find the context.
The commit message then goes on to explain how the patch solves that
problem, but without an example to put that explanation in context, it
is hard to follow. What linear search is the explanation talking
about? What is the interesting commit we find? I couldn't tell without
looking at the code.
prev parent reply other threads:[~2015-06-30 22:48 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-06-26 19:40 [PATCH] revision.c: Remove unneeded check for NULL Stefan Beller
2015-06-27 6:07 ` Jeff King
2015-06-30 22:48 ` Jonathan Nieder [this message]
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=20150630224814.GB4865@google.com \
--to=jrnieder@gmail.com \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=peff@peff.net \
--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 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).