RFC: startup time - again

John Arbash Meinel john at arbash-meinel.com
Wed Sep 10 04:49:53 BST 2008


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1



...

>> 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.

Sure, except if we can cut off an unnecessary dependency (like what is
ConfigObj using 'compiler' for, and can we get rid of that?)

Big wins in the past have been lazy importing "bzrlib.gpg" because it depended
on 'subprocess' which pulled in pickle and all sorts of things. Even though
'repository' only used it when committing with "sign = True".

So I agree that we shouldn't be optimizing for avoiding 'import
bzrlib.workingtree' it is the next layer of imports we need to work on.

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

Sure.

> 
> 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

Right. Technically we don't need anything from bzr-svn except to detect if the
given URL is going to be SVN. I would imagine the SVNBzrDirFormat code is
significantly less than SVNBzrDir or SVNBranch, etc.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFIx0PgJdeBCYSNAAMRAko8AKCc0MbJiiWC8Qmt4H7+3LIlp4e7tACdEK2i
VHKG6VJahe3GG/pG6rcxmo4=
=MEen
-----END PGP SIGNATURE-----



More information about the bazaar mailing list