Bazaar-NG vs. Mercurial -- speed comparison
John Arbash Meinel
john at arbash-meinel.com
Thu May 18 21:37:40 BST 2006
Bryan O'Sullivan wrote:
> On 5/18/06, John Arbash Meinel <john at arbash-meinel.com> wrote:
>
>> Well, unfortunately it doesn't really do everything that you might want
>> it to do.
>
> That's true.
>
>> Though maybe you could do:
>> demandload(globals(), 'bzrlib:errors')
>> But that loads the 'errors' member of bzrlib, not the actual module.
>
> Are you sure? I would have expected it to load the module, but it's
> been a while since I looked.
>
>> So I'll keep playing, but in the meantime it isn't just a drop-in
>> replacement.
>
> OK, fair enough; I'd have hoped it would be a simple drop-in
> replacement, but it looks like it handles exactly our importing needs,
> and not all general cases. If you find that you need to make some
> fixes, we'll be happy to take patches.
>
Well, the attached patch helps. It implements __call__ so that
demandload can load functions and classes, and not just modules.
(So if you access foo() rather than just foo.* it still works).
demandload still doesn't work for constants. But I'm working through the
code to change stuff like:
from bzrlib.revisions import NULL_REVISION
if x == NULL_REVISION:
into:
import bzrlib.revisions
if x == bzrlib.revisions.NULL_REVISION
In general, I think it is a programming style thing, more than that
demandload can't do what we want. If demandload helps, then I think it
is worth the little bit of effort to change programming style.
John
=:->
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: demandload.diff
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060518/fdf7f352/attachment.diff
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 254 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060518/fdf7f352/attachment.pgp
More information about the bazaar
mailing list