All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCHv6 10/10] gitweb: group remote heads by remote
Date: Mon, 8 Nov 2010 14:41:42 +0100	[thread overview]
Message-ID: <201011081441.44572.jnareb@gmail.com> (raw)
In-Reply-To: <AANLkTikK1C5zzfOKSucPhOAQV3E=mrOunpyv4NhN+Od6@mail.gmail.com>

On Mon, Nov 8, 2010, Giuseppe Bilotta napisał:
> On Mon, Nov 8, 2010 at 12:05 PM, Jakub Narebski <jnareb@gmail.com> wrote:
>> On Mon, 8 Nov 2010, Giuseppe Bilotta wrote:
>>> On Thu, Nov 4, 2010 at 11:41 AM, Jakub Narebski <jnareb@gmail.com> wrote:
>>>> On Wed, 3 Nov 2010, Giuseppe Bilotta wrote:
[...]
>>>> BTW. would next version of this series include patch to git-instaweb
>>>> enabling 'remote_heads' feature for it (gitweb_conf function)?
>>>
>>> I will look into that.
>>
>> It can be as simple as
>>
>> diff --git i/git-instaweb.sh w/git-instaweb.sh
>> index e6f6ecd..50f65b1 100755
>> --- i/git-instaweb.sh
>> +++ w/git-instaweb.sh
>> @@ -580,6 +580,8 @@ gitweb_conf() {
>>  our \$projectroot = "$(dirname "$fqgitdir")";
>>  our \$git_temp = "$fqgitdir/gitweb/tmp";
>>  our \$projects_list = \$projectroot;
>> +
>> +$feature{'remote_heads'}{'default'} = [1]
>>  EOF
>>  }
> 
> Thanks.

I forgot about trailing semicolon.  It should be:

    +$feature{'remote_heads'}{'default'} = [1];

>>> Either solution is fine, but it would require grabbing all the remote
>>> heads. The real issue here is, I think understanding what is the
>>> purpose of limiting in gitweb. Is it to reduce runtime? is it to
>>> reduce clutter on the screen? In the first case, the limiting should
>>> be done as early as possible (i.e. during the git call that retrieves
>>> the data); in the latter case, is it _really_ needed at all?
[...]

>> Regarding gitweb performance, it is quite important to pass limit to
>> git-log / git-rev-list needed also for 'summary' view; passing limit
>> to git command really matters here.
>>
>> git_get_heads_list passes '--count='.($limit+1) to git-for-each-ref,
>> but I don't think that it improves performance in any measurable way.
>> Similar with saving a memory: it is negligible amount.  So if we can
>> do better at the cost of running git_get_heads_list without a limit,
>> I say go for it.
> 
> The gain in performance is, I believe, related to the number of heads
> and the number of remotes that are to be enumerated. 11 remotes with a
> total of 58 remote branches (the case you mentioned, for example)
> might not feel much of a difference between pre- and post-filtering,
> but something bigger might start to feel the effect.

Actually I would guess it would depend on what git-for-each-ref does
it.  I would guess that git-for-each-ref reads in all refs anyway,
the limit only matters if format contains fieldnames that need accessing
the object,... like e.g. '%(subject)' which git_get_heads_list requests,
but git_heads_body doesn't use.  Ehh...
 
> I think the strongest point in favour of post-filtering is that the
> feature is intended for use mostly for local repositories anyway.

True.
 
>> Note that the costly part of git_get_heads_list is forking git command,
>> so it makes absolutely no sense to run git_get_heads_list once per
>> remote instead of doing limiting per-remote in Perl.  The former would
>> affect performance badly, I can guess.
> 
> That is indeed the reason why I chose to go the single call way, even
> though it meant having the limit end up being used somewhat
> incorrectly.

I think that single call and post-filtering would be reasonable 
compromise: reasonable performance (single fork), and correct results.

-- 
Jakub Narebski
Poland

  reply	other threads:[~2010-11-08 13:42 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-10-24 10:45 [PATCHv6 00/10] gitweb: remote_heads feature Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 01/10] gitweb: introduce " Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 02/10] gitweb: git_get_heads_list accepts an optional list of refs Giuseppe Bilotta
2010-10-25 21:56   ` Jakub Narebski
2010-10-26 16:30     ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 03/10] gitweb: separate heads and remotes lists Giuseppe Bilotta
2010-10-25 15:01   ` Jakub Narebski
2010-10-25 18:14     ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 04/10] gitweb: nagivation menu for tags, heads and remotes Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 05/10] gitweb: use fullname as hash_base in heads link Giuseppe Bilotta
2010-10-25 14:56   ` Jakub Narebski
2010-10-25 15:07     ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 06/10] gitweb: allow action specialization in page header Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 07/10] gitweb: remotes view for a single remote Giuseppe Bilotta
2010-10-25 15:12   ` Jakub Narebski
2010-10-25 18:18     ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 08/10] gitweb: refactor repository URL printing Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 09/10] gitweb: provide a routine to display (sub)sections Giuseppe Bilotta
2010-10-25 15:15   ` Jakub Narebski
2010-10-25 18:21     ` Giuseppe Bilotta
2010-10-24 10:45 ` [PATCHv6 10/10] gitweb: group remote heads by remote Giuseppe Bilotta
2010-10-27  0:32   ` Jakub Narebski
2010-10-27  8:07     ` Jakub Narebski
2010-11-02 10:49     ` Giuseppe Bilotta
2010-11-02 23:58       ` Jakub Narebski
2010-11-03  7:49         ` Giuseppe Bilotta
2010-11-04 10:41           ` Jakub Narebski
2010-11-08  8:28             ` Giuseppe Bilotta
2010-11-08 11:05               ` Jakub Narebski
2010-11-08 11:18                 ` Giuseppe Bilotta
2010-11-08 13:41                   ` Jakub Narebski [this message]
2010-10-27 12:38   ` Jakub Narebski
2010-10-25 18:38 ` [PATCHv6 00/10] gitweb: remote_heads feature Jakub Narebski

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=201011081441.44572.jnareb@gmail.com \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=giuseppe.bilotta@gmail.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.