Bzr's startup time

Aaron Bentley aaron.bentley at utoronto.ca
Mon Jun 26 17:45:14 BST 2006


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

Martin Pool wrote:
> On 26 Jun 2006, Matthieu Moy <Matthieu.Moy at imag.fr> wrote:
>>It would probably be wise to split the command functions in
>>builtins.py into a trivial function doing only the argument parsing,
>>and calling a function in another file, which in turn would do the
>>correct imports and perform the actual job.
> 
> 
> This is the kind of approach we want regardless of load time - splitting
> the details of command line parsing from the high level operation
> itself.  It makes it more reusable for say people writing a GUI.  Some
> commands do this more consistently than others; we should sometime do a
> pass through and shrink or separate the command functions.

> 
> This still leaves the question of how the implementation gets loaded: it
> can be either from inside the method or through a demandload.

I'm still quite fond of the approach I used in Bugs Everywhere, in which
each command corresponds to a module with the same name.  In BE, when
you run 'be set-root', it finds a file named 'becommands/set_root.py'
and imports it.

I believe we could easily integrate that approach with our current
structure, except that we would need to change alias handling.  Keeping
aliases in the Command object would mean they would not be loaded when
we needed them, so we would need to separate the alias list from the
Command objects.

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

iD4DBQFEoA8a0F+nu1YWqI0RAvjEAJiVLkE4+4IKvS5jWY4/F/mRRwEfAJwJuwG+
SEUBgF7JfTaEhphmD9eWiQ==
=lip1
-----END PGP SIGNATURE-----




More information about the bazaar mailing list