RFC: centralise registries
Vincent Ladeuil
v.ladeuil+lp at free.fr
Wed Apr 15 08:05:24 BST 2009
>>>>> "robert" == Robert Collins <robert.collins at canonical.com> writes:
robert> On Wed, 2009-04-15 at 08:12 +0200, Vincent Ladeuil wrote:
>> Then create bzrlib/selftest.py, put the registry there, and lazy
>> load bzrlib.tests there ?
>>
>> That seems to be the less of 3 or 4 evils :-/
>>
>> That will at least address your initial concern (if I remember
>> correctly): avoid loading the tests only to register a test suite
>> decorator from a plugin.
robert> Its *one* of many registries that are
robert> problematic.
Don't shout ! :) I was throwing *another* idea in the mix not
*the* idea.
robert> And adding a bunch of separate python files will just
robert> add to performance headaches, not remove.
AFAIK several ideas has been proposed to address the slow load
problem, none have been completely implemented. And I seem to
remember that you were keen to consider the whole code base as
loaded, always.
Until then, I don't think adding one more python file will change
the size of problem.
*BUT* loading all the test code when loading a plugin at *each*
bzr invocation has certainly a cost *today*.
robert> I want to find a small, clean, scalable fix. I think
robert> a load time callback may be it.
I don't disagree :)
It's a known and powerful concept (called eval-after-load in
emacs) and that's certainly an alternative to some forms of lazy
loading.
Vincent
More information about the bazaar
mailing list