[Zope-CMF] RE: [Zope-dev] Performance problem in ZOPE 2.5.1, 'getOwner' in /lib/python/AccessControl/Owned.py

Toby Dickenson tdickenson@geminidataloggers.com
Mon, 9 Sep 2002 07:42:01 +0100


On Saturday 07 Sep 2002 3:18 pm, Florent Guillaume wrote:
> Stefan H. Holek <stefan@epy.co.at> wrote:
> > Gotcha! I did actually expect that.
> >
> > XUF defines __len__ to return the number of users. This absolutely ki=
lls
> > performance on Zope 2.4+
> >
> > See my patch at http://www.zope.org/Members/shh/Patches
>
> Hmm, just curious: what part of the code does (implicitely or
> explicitely) call __len__ on the user folder?

I *guess* it is code that is testing the truth value of the user folder=20
object.=20

Does adding this method fix the problem too:

    def __nonzero__(self):
        return 1