Expensive plugins

Martin Pool mbp at canonical.com
Tue Jun 1 23:30:36 BST 2010


On 2 June 2010 01:04, John Arbash Meinel <john at arbash-meinel.com> wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Gary van der Merwe wrote:
>> On 01/06/10 15:50, Gary van der Merwe wrote:
>>> I wrote script to do
>>> $ export BZR_DISABLE_PLUGINS=[all other plugins]
>>> $ time bzr rocks
>>> for each plugin that I have installed on my desktop, then take the real
>>> time for each of those and subtract a baseline time bzr rocks --no-plugins

That was a good thing to measure.

> Just to mention, a more valid test is to run "bzr status" (in an minimal
> working tree) for this.
>
> It is interesting to see what plugins import, but honestly, it isn't
> very representative of what overhead they actually introduce versus
> day-to-day tasks.
>
> For example, I'm pretty sure "from bzrlib import branch" is expensive,
> bet you have to do it to get any real work done. So I don't think
> plugins that use it need to go to excessive contortions to avoid it.

And I'd highly recommend looking at running test_import_tariff with
these plugins enabled until it passes, and then possibly tightening
the tests there.  For example, we shouldn't load either qt or gtk to
run a plain 'bzr st' and you can very easily add an assertion of that.

Jelmer recently removed an unnecessary import of kerberos and it was a
one-line change to make sure that change sticks:

=== modified file 'bzrlib/tests/test_import_tariff.py'
--- bzrlib/tests/test_import_tariff.py	2010-05-20 18:23:17 +0000
+++ bzrlib/tests/test_import_tariff.py	2010-05-31 01:31:24 +0000
@@ -96,6 +96,7 @@
             'bzrlib.remote',
             'bzrlib.sign_my_commits',
             'bzrlib.smart',
+            'kerberos',
             'smtplib',
             'tarfile',
             ])



-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list