[Zope-CMF] [CMF 2.1] opaque items calls make performance issue

Wichert Akkerman wichert at wiggy.net
Sat Aug 8 12:51:51 EDT 2009


On 2009-8-8 11:53, Hanno Schlichting wrote:
> On Sat, Aug 8, 2009 at 12:14 AM, Charlie Clark<charlie at begeistert.org>  wrote:
>> Is the patch for Plone or CMF?
>
> It's for Plone, I guess. The "problem is solved" in Plone 4.0 itself
> (via monkey-patching CMF).
>
>> If it's for CMF then you should consider simply submitting a patch or
>> opening a branch. But before you write any package I would like to know a
>> little more about what exactly you want to do.
>
> The problem is the entire concept of opaque items. The only places I
> know they are still in use is the "talkback" objects as used by the
> discussion machinery in CMF. CMFUid also claims to implement the
> concept, but doesn't actually need any of the functionality, since it
> has its own event subscribers to deal with things.
>
> So the problem starts in
> CMFCore.CMFCatalogAware.dispatchToOpaqueItems, with the nice line:
>
> for opaque in ob.opaqueValues():
>
> which in turn calls later on the opaqueItems method which contains this beauty:
>
> self_base = aq_base(self)
> for name in self_base.__dict__.keys()
>    obj = getattr(self, name)
>    if ICallableOpaqueItem.providedBy(obj):
>      items.append((obj.getId(), obj))
>
> The whole method redispatches any IObjectEvent fired on an
> IOpaqueItemManager to any opaque item in it. In doing so, it needs to
> load every single entry in the objects __dict__ to see if it is an
> ICallableOpaqueItem.
>
> It happens that the CMFCatalogAware base class is such an
> IOpaqueItemManager, so any essentially any content object gets this
> treatment.

Could it be that this considers dexterity content to be opaque items? I 
have some code where events are recursively re-dispatched by CMF and I 
suspect this is why.

Wichert.


-- 
Wichert Akkerman <wichert at wiggy.net>   It is simple to make things.
http://www.wiggy.net/                  It is hard to make things simple.


More information about the Zope-CMF mailing list