RFC: startup time - again

Robert Collins robertc at robertcollins.net
Tue Sep 9 22:34:55 BST 2008


On Tue, 2008-09-09 at 10:15 -0500, John Arbash Meinel wrote:

> Just to mention, I think what Matthew is actually seeing is that "lp"
> imports bzrlib.branch.Branch. If you removed it from the import stream,
> the other plugins will just do the same thing. (bzr rocks, itself, does
> not need to.)
>
> Certainly bzr-svn is going to be importing a lot of that code, because
> it uses it to define its own classes and install the appropriate formats.

Sure.

> Also, the launchpad plugin depends on 'directory_services' which in my
> testing is about 70ms (mostly due to dependencies.)
> 
> Fixing import times tends to be Whack-a-mole because making one module
> lazily import things it doesn't need, just shows another one in the
> chain that *does the same thing*.

I think that import time optimisation via lazy import doesn't _really_
fix anything. It just stops it being a constant cost for all commands.

e.g. anything thats faster because 'bzrlib.workingtree_4' isn't
imported, is not going to be faster for actual users.

Making bzr st faster, or bzr init, etc - those are the only tests that
are actually _useful_.

So for instance, to really assess what bzr-svn costs us:

:!time bzr st
real    0m0.472s
user    0m0.412s
sys     0m0.060s

<disable the svn plugin only>

:!time bzr st

real    0m0.514s
user    0m0.388s
sys     0m0.112s

Its current incremental cost ireally is only 42ms, which its true, is
large (10%), but not the 120ms that simply comparing import
bzrlib.plugins with bzrlib.plugins.svn would suggest.

[Jelmer, btw, can we shrink that 42ms?]

-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/20080910/4bde71a0/attachment.pgp 


More information about the bazaar mailing list