RFC: startup time - again
Robert Collins
robertc at robertcollins.net
Thu Sep 11 12:32:46 BST 2008
On Thu, 2008-09-11 at 12:24 +0200, Dennis Benzinger wrote:
>
>
> Then I'm happy with whatever C code it takes to make Bazaar faster.
> I'd
> prefer Cython/Pyrex code over hand written C for hackability, but
> that's
> your decision.
I'm rapidly coming to the conclusion that for things its worth writing
pyrex for, its worth writing plain C. Yes pyrex is more hackable, but
its not tunable enough without becoming less hackable than plain
CPython-api-using-C would be.
> > bzr-svn already needs C, because the python bindings for libsvn were
> > such a headache the author of bzr-svn wrote his own. I think plugins
> are
> > entirely unrelated to whether or not the core uses C (it already
> does) -
> > because plugins can choose to need, or not need C, themselves.
> > [...]
>
> If some parts of Bazaar are coded in C can Python plugins still
> interface with these parts? Or are all the interesting places where a
> plugin would want to hook in are still Python?
This could mean several things. So I'll answer them all. (Note that some
parts of Bazaar are already coded in C [as described in the post you
replied to].
"Can plugins use functions which are written in C" -> "Yes, of course -
whatever interface the python version supplies, is also supplied by the
C version [or it would not be equivalent]."
"Can plugins subclass classes which are extension types to change their
behaviour" -> "I'm not sure, I haven't tried. subclassing is a pretty
poor way to customise things anyhow, I'd be inclined to just subclass
the pure python implementation if I needed to do this."
"Hypothetically, if more of the code was in C, would it be hard to make
sure things are as hookable as they are today" -> "It would definitely
be more work to be as mutable, but the discipline of thinking about
hookability explicitly is something we already do : the formally
supported hooking areas of bzr are quite large."
Also note that things outside of critical loops are really not worth
moving into C in general, python is plenty fast for run-code-once tasks.
Ciao,
-Rob
--
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080911/5e872e7f/attachment.pgp
More information about the bazaar
mailing list