[Zope-dev] Cache code in Shared/DC/ZRDB/DA.py

Chris Withers chris at simplistix.co.uk
Thu Nov 16 12:29:08 EST 2006


Hi Jim,

I'm wondering if you can still remember the rational behind the cache 
code at around lines 355-387 of:

http://svn.zope.org/Zope/trunk/lib/python/Shared/DC/ZRDB/DA.py?rev=68158&view=auto

This code is pretty old (checked in 5th Dec 1997) but has started 
causing a few people problems under high load:

http://mail.zope.org/pipermail/zope-db/2006-September/004684.html
http://www.zope.org/Collectors/Zope/2212

In particular:

- in line 368, why is len(cache)>max_cache/2 used as a trigger to start 
cache clearing? (the /2 in particular)

- does it matter that IOBTree.Bucket has gone away and that tcache is
   now a simple dictionary? It certainly seems to make the keys.reverse()
   on line 370 superfluous and the keys[-1]<t on line 371 less reliable.

More generally, do you or does anyone else have any attachment to this 
code or would anyone mind if I ripped it out and replaced it with 
something simpler, with more comments and unit tests?

cheers,

Chris

-- 
Simplistix - Content Management, Zope & Python Consulting
            - http://www.simplistix.co.uk


More information about the Zope-Dev mailing list