RFC: startup time - again

John Arbash Meinel john at arbash-meinel.com
Wed Sep 10 16:36:11 BST 2008


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

Paul LeoNerd Evans wrote:
> On Tue, 09 Sep 2008 22:42:26 +0900
> David Cournapeau <david at ar.media.kyoto-u.ac.jp> wrote:
> 
>> I noticed that bzr-svn is significant in the overhead of plugins. I
>> don't need bzr-svn most of the time, but OTOH, I guess it is not so easy
>> avoiding using it if you don't need it (because only bzr-svn knows about
>> this :) ). Maybe the slow parts of bzr-svn can be delayed upon use, though.
> 
> Or just replace the entire plugin with a tiny one that registers the same
> hooks, but just lazy-loads then forwards to the real one if any of those
> hooks are actually called..?
> 

Well, some of the hooks are going to get called a lot. They are part of the
"lookup a branch at location X" code. I believe we probe for all possible
formats at each directory. So even if we probe for bzr formats first doing:

cd project/subdirectory
bzr st

Is going to probe for all formats in "subdirectory" and then look in "project"
for all formats (though at that time you have a bzr format and it stops
"quickly".)

So you need a bit of flexibility about what is and isn't loaded. Also, you can
do this simply in bzr-svn by just being careful about what is in your
"__init__.py" script.

In most of my plugins, I only load the essentials (commands, options, etc) in
__init__.py and then import another module in the Command.run() function.

John
=:->

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

iD8DBQFIx+lrJdeBCYSNAAMRAvePAJ0cIgz643if98ty00fjpmD7PLWL5gCeMTJX
s/HrSu2h9GNyO2kF1lPbhiE=
=8U9m
-----END PGP SIGNATURE-----



More information about the bazaar mailing list