From: Jakub Narebski <jnareb@gmail.com>
To: Dan Zwell <dzwell@gmail.com>
Cc: Petr Baudis <pasky@suse.cz>, Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] Git.pm: Don't return 'undef' in vector context.
Date: Sat, 17 Nov 2007 16:19:17 +0100 [thread overview]
Message-ID: <200711171619.18141.jnareb@gmail.com> (raw)
In-Reply-To: <473E5E08.2090609@zwell.net>
On Saturday, 17 November 2007, Dan Zwell wrote:
> Jakub Narebski wrote:
> >
> > By the way, what do you think about changing Git.pm config handling
> > to the 'eager' one used currently by gitweb, namely reading all the
> > config to hash, and later getting config values from hash instead of
> > calling git-config? Or at least make it an option?
> >
>
> That seems appropriate, though it may be a slight trade-off between
> complexity and efficiency. I don't think it's strictly necessary, at
> least for git-add--interactive.
On one hand it adds a bit of complexity, as you have to check if
config was parsed (and either parse, as it is done now in gitweb,
or perhaps fallback on calling git-config per variable), and you
have to do type checking / conversion to bool and int (size suffixes!)
in Perl, and deal with single-value and multi-value variables.
On the other hand I think that error handling will be simplier.
> My experience is that the nine calls to
> config() (that I am adding) do not slow down the program from a user
> perspective (though I haven't tested on a slower computer).
The problem is not so much with a slower computer, as operating
systems with inefficient, slow fork implementation, like MS Windows
and (if I remember) correctly MacOS X.
But it is true that the config() performance is needed less for desktop
(commands like git-add--interactive) than for web (gitweb for example).
> The big reason to do it would be if you wanted to convert gitweb to use
> the standard config() call from Git.pm. Because right now, config()
> isn't efficient, but it probably doesn't need to be.
There are two reasons against convering gitweb to use Git.pm, at least
for now.
First, it makes installing gitweb harder, as one would have to install
(and perhaps compile) Git.pm to use gitweb. It would add additional
dependency. But perhaps this is not as much a problem as I think...
Second, gitweb code contain in few places pipelines (e.g. tar.gz and
tar.bz2 snapshot pipelines); even if some of them can be eliminated,
some will be added (syntax highlighting in blob view). Git.pm doesn't
as of yet support this...
It would be nice if Git.pm could take advantage of libification project,
and git have fast bindings not only for Python but also for Perl. If I
remember correctly the early attempts to use "git library" directly
were abandoned becaue they were not sufficiently portable, and the
fallback-to-Perl idea was thought too complex to implement...
--
Jakub Narebski
Poland
prev parent reply other threads:[~2007-11-17 15:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2007-11-16 6:15 [PATCH] Git.pm: Don't return 'undef' in vector context Dan Zwell
2007-11-16 6:39 ` Junio C Hamano
2007-11-16 8:00 ` Dan Zwell
2007-11-17 0:39 ` Junio C Hamano
2007-11-16 12:47 ` Sebastian Harl
2007-11-16 8:43 ` Jakub Narebski
2007-11-17 3:20 ` Dan Zwell
2007-11-17 15:19 ` Jakub Narebski [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=200711171619.18141.jnareb@gmail.com \
--to=jnareb@gmail.com \
--cc=dzwell@gmail.com \
--cc=git@vger.kernel.org \
--cc=pasky@suse.cz \
/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).