[PATCH] better python plugins (well, better IMHO)
Aaron Bentley
aaron.bentley at utoronto.ca
Sun Jun 12 17:12:35 BST 2005
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Lalo Martins wrote:
> Plugins are now loaded on bzrlib
> initialization, and they're free to register whatever components they
> like.
> - John's code has a comment stating subdirectories from the plugin path
> will be searched one level down; but there was nothing on his code that
> implemented this. I didn't add the feature; personally I think it's
> silly and will slow down startup.
You think *that* will slow down startup? Personally, I think your
changes will slow down startup, because they require unconditional
loading of every plug-in the user has installed. We have already been
trying to improve startup speed by reducing the number of useless
imports-- this is a push in exactly the opposite direction.
When plugins are just for commands, you can load only the command you
need. A simple naming convention means that if you issue the command
"bzr funky-stuff", bzr can look for funky_stuff.py in the whole plugin
path, and either load it, or report "no such command". The only time
you have to load every plugin is when you're listing all commands.
That doesn't seem to be the way plugins are currently handled, but it
could be, and for my money even searching subdirectories under that
system would be faster than your proposal to load every single plugin
every time bzr is run.
Aaron
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org
iD8DBQFCrF7y0F+nu1YWqI0RAvuNAJ4g6aJCgRWy7G2iKe036Dyjti4jkgCffXJb
8nSai3zX0CtIMc/6AtRqPJk=
=Bmsc
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list