import tariffs
John Arbash Meinel
john at arbash-meinel.com
Wed Feb 10 17:50:22 GMT 2010
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Martin Pool wrote:
> One way we can speed up Bazaar is to load less code at startup: this
> particularly helps on machines with magnetic disks and cold caches,
> but it's a good idea everywhere. There are various things we can do
> including making things lazily loaded from registries and trimming
> unnecessary imports. People have patched these in the past but it is
> easy for them to regress.
>
> <https://code.edge.launchpad.net/~mbp/bzr/tariff/+merge/18970> adds a
> framework for checking what is loaded and some documentation;
> <https://code.edge.launchpad.net/~mbp/bzr/trim-imports/+merge/18971>
> is a small example of using it.
>
> The next big step is probably to make more commands be lazily loaded.
>
We also have to consider plugins, etc. I think getting the commands
setup refactored a bit would be good, and push us in the right direction.
But right now, some of the code that gets imported is because of:
1) Overriding an existing command in a plugin. Probably could be done
with a lazy registry.
2) Needing to register a Hook, which requires importing the module that
has the HookPoint. One option would be to move to a 'all HookPoints are
defined in module hookpoint.py'. At least, we ran into that for the
per-file merge hooks. We now always have to load 'merge.py' which is a
fairly involved module, and isn't needed for a lot of commands.
John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/
iEYEARECAAYFAkty8d4ACgkQJdeBCYSNAAMOVACgjlqoqLneHzy95Oa9isrgNfxJ
Bh4AoJyIP7900hrLdc2spAO/BXwbBoKv
=wDVa
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list