RFC: startup time - again

John Arbash Meinel john at arbash-meinel.com
Tue Sep 9 16:15:23 BST 2008


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

David Cournapeau wrote:
> Matthew D. Fuller wrote:
>> Now, when I wipe out bzrlib/plugins/launchpad, there's that ~100ms
>> back.  So a quarter of the time used by 'bzr rocks' is used in the
>> launchpad plugin.
>>   
> 
> This is not surprising: lp plugin import both xmlrpclib (which is really
> slow to import) and urlparse (which is surprising slow to import as
> well); we do not use xml stuff in numpy, but I specifically remember
> urlparse being slow, and we delayed import for this one. Just importing
> those two takes around 35 ms (from 235 ms taken by bzr rocks, wo taking
> into account python launch itself in both cases)
> 
> cheers,
> 
> David

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.

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

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

iEYEARECAAYFAkjGkwsACgkQJdeBCYSNAAPnMgCgsouFErnrAgUz2NNF/iu8o9y4
lVAAnjz1QXxB87+uZG2Rl6XRwuXoGMGf
=ofnI
-----END PGP SIGNATURE-----



More information about the bazaar mailing list