git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jakub Narebski <jnareb@gmail.com>
To: git@vger.kernel.org
Subject: Re: [PATCH/RFC] gitweb: Great subroutines renaming
Date: Tue, 08 Aug 2006 00:15:05 +0200	[thread overview]
Message-ID: <eb8e12$2aa$1@sea.gmane.org> (raw)
In-Reply-To: 7v4pwo1a0r.fsf@assigned-by-dhcp.cox.net

Junio C Hamano wrote:

> Jakub Narebski <jnareb@gmail.com> writes: 

>> What is also important is the fast that git_read_* functions are fast,
>> with exception of git_read_info_refs...
> 
> Hmph.  readdir-refs is quite bad for future compatibility, so is
> read_hash.

Fast = doesn't call git commands, so no delay for fork+exec.

> If you want _fast_ then make the implementation fast (or leave
> room to make it fast later); encoding the fastness assumption in
> the name IS WRONG.

Matthias Lederhofer has noticed that parsing all the tags in "summary" and
"tags" views, while we use only epoch/timestamp information to sort them
and discard most of parsed input, is bottleneck due to the fact that
usually number of tags is linear with history (version tags) and the fact
that for each tag is one invocation of git (one fork, two execs).

> For example, sub git_get_hash (not git_read_hash) can stay as
> (potentially buggy wrt symrefs) "reading from .git/refs/$thing"
> or could even be fixed to read from git-rev-parse (which is the
> kosher way).  If it turns out to be a bottleneck, it could be
> rewritten using Git.xs.  The same thing for read_refs which I
> think should be doing ls-remote on the repository if it wants to
> be kosher.

True. So _read_ based on actually reading the files is out.
git_get_hash_by_ref, git_get_HEAD_hash (or just git_get_ref, git_get_head)
return single scalar value; git_read_info_refs and git_read_refs return
reference to hash or array, while git_read_projects returns array.

So the new guidelines would be:
* git_get_ prefix for subroutines related to git repository
  and returning single scalar (single value).
* git_read_ prefix for subroutines related to git repository, reading some
  files or multiline output, and returning hash reference, or list
  reference, or list.

-- 
Jakub Narebski
Warsaw, Poland
ShadeHawk on #git

  reply	other threads:[~2006-08-07 22:15 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-07 14:26 [PATCH/RFC] gitweb: Great subroutines renaming Jakub Narebski
2006-08-07 19:37 ` Junio C Hamano
2006-08-07 21:47   ` Jakub Narebski
2006-08-07 21:52     ` Jakub Narebski
2006-08-07 22:00     ` Junio C Hamano
2006-08-07 22:15       ` Jakub Narebski [this message]
2006-08-07 22:58         ` Jakub Narebski
2006-08-07 23:49         ` Junio C Hamano
2006-08-08  0:10           ` Jakub Narebski
2006-08-08  9:38           ` Jakub Narebski
2006-08-08 20:18             ` Junio C Hamano
2006-08-08 20:24               ` Jakub Narebski
2006-08-08  9:51           ` Jakub Narebski
2006-08-08 18:12           ` git-show-refs (was: [PATCH/RFC] gitweb: Great subroutines renaming) Jakub Narebski
2006-08-09 10:26           ` [PATCH/RFC] gitweb: Great subroutines renaming Jakub Narebski
2006-08-09 10:51             ` Junio C Hamano
2006-08-09 11:01               ` Jakub Narebski
2006-08-09 11:11                 ` Junio C Hamano
2006-08-08  9:48     ` Jakub Narebski
2006-08-08 21:13 ` Jakub Narebski
2006-08-08 21:50   ` Junio C Hamano
2006-08-08 22:33     ` Jakub Narebski
2006-08-09 20:54       ` Jakub Narebski
2006-08-09 21:11         ` Junio C Hamano
2006-08-10  7:57           ` Jakub Narebski
2006-08-12 23:09 ` Jakub Narebski
2006-08-13  2:21   ` Junio C Hamano
2006-08-13  2:27     ` Junio C Hamano
2006-08-13  9:29     ` Jakub Narebski
2006-08-14  0:11       ` 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='eb8e12$2aa$1@sea.gmane.org' \
    --to=jnareb@gmail.com \
    --cc=git@vger.kernel.org \
    /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).