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

Arnar Lundesgaard arnar.lundesgaard@creuna.no
Thu, 5 Sep 2002 15:25:47 +0200


Hi,

  as I have written on this list before,  we have had serious
  performance problems on one of our CMF based sites.

For a long time we believed that this was mostly due to load, and
differences in our application. Unfortunately the more we searched for
answers the less we understood. Recently we have converted to a ZEO
setup, and that has made it much easier to locate hotspots in the
application.

One of things we have seen, is in our skinned 'folder_contents', which
includes the name of the objects owner. This is fetched by using the
'Creator' method from the DublinCore mixin. This again calls getOwner
of 'AccessControl/Owned.py'.


On the first site we have set up (using the same application, whose
performance currently is quite good) and folder_contents is virtualy
instantaneous. Therefore we tried using the default skin. The
difference was astonishing, and we are seeing a difference of 20-30
seconds.

We started removing functionality, and we quickly found the culprit.


In the CVS log for Owned.py it says (around 1.15.10.2):

   Remove cache from getOwner, since it would
   have cached both unwrapped and wrapped
   objects (caching wrapped objects being a
   bad thing)


This change seems to be the difference between our two sites, and it
will also affect other parts of our application. For instance when we
reindex objects on change, since Creator is both an index and a
metadata field.


Can we simply change this file? What are the consequences of having or
not having the cache?



  Arnar Lundesgaard

-------------------------------------
phone: (+47) 982 38 036
mailto:arnar.lundesgaard(at)creuna.no
Creuna as
Bryggegata 3
NO-0250 Oslo
phone office: (+47) 23 23 88 00
fax: (+47) 23 23 88 50
http://www.creuna.no/