On Tuesday 05 April 2005 01:29 pm, Dieter Maurer wrote:
> In our regular profiles, "listFilteredActionsFor" belongs to
> the top consumers of CPU time.
> Recently, I found the main culprit (in CMF 1.4):
>    It is the completely unnecessary:
>       if not action in catlist:
> In our case, "listFilteredActionsFor" spends about 70 percent
> of its complete time in the checking of "action in catlist".
> How in hell should the same action be defined more than once
> such that we need to prevent such a case by an explicit check --
> especially by such an expensive one?
> A comment before the line indicates that the author intended
> to check by identity. But, of course, "action in catlist"
> does *NOT* check by identity but by equality.
> I propose to remove the check altogether...

This is duplicated in CMFPlone as well, so it can be removed there too.  I 
think the purpose of this may have been to eliminate duplicate actions 
defined in different action containers (so that one could e.g. override an 
object action defined sitewide with one defined on a type).  But of course 
this check does not actually do that, or apparently anything useful.  
Removing it sounds like an excellent idea.

It would be nice if two actions with the same id and category from different 
action containers did not result in duplication, but the method is slow 
enough as it is.

Zope-CMF maillist  -  Zope-CMF@lists.zope.org

See http://collector.zope.org/CMF for bug reports and feature requests

Reply via email to