[Python-Dev] PEP 376 proposed changes for basic plugins support

Glyph Lefkowitz glyph at twistedmatrix.com
Mon Aug 2 17:25:15 CEST 2010


On Aug 2, 2010, at 9:53 AM, exarkun at twistedmatrix.com wrote:

> On 01:27 pm, mal at egenix.com wrote:
>> exarkun at twistedmatrix.com wrote:
>>> On 12:21 pm, mal at egenix.com wrote:
>>>> 
>>>> See Zope for an example of how well this simply mechanism works out in
>>>> practice: it simply scans the "Products" namespace for sub-packages and
>>>> then loads each sub-package it finds to have it register itself with
>>>> Zope.
>>> 
>>> This is also roughly how Twisted's plugin system works.  One drawback,
>>> though, is that it means potentially executing a large amount of Python
>>> in order to load plugins.  This can build up to a significant
>>> performance issue as more and more plugins are installed.
>> 
>> I'd say that it's up to the application to deal with this problem.
>> 
>> An application which requires lots and lots of plugins could
>> define a registration protocol that does not require loading
>> all plugins at scanning time.
> 
> It's not fixable at the application level, at least in Twisted's plugin system.  It sounds like Zope's system has the same problem, but all I know of that system is what you wrote above.  The cost increases with the number of plugins installed on the system, not the number of plugins the application wants to load.

We do have a plan to address this in Twisted's plugin system (eventually): <http://twistedmatrix.com/trac/ticket/3773>, although I'm not sure if that's relevant to the issue at hand.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100802/f1b32f88/attachment.html>


More information about the Python-Dev mailing list