Re: Schema provider/CA lookup status
Jean Jordaan <jean-kb4xc5yObU3kQYj/0HfcvhBnub05S5/[email protected]> Thu, 27 Jul 2006 18:13:38 +0200
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
Hi Martin > So what is a valid hash? We used the id() of the schema as the hash, as a stopgap measure. This only works if any methods that modify the schema also invalidate the cache. We haven't done this yet. A valid hash could be the id(schema) plus the modification date of the schema. A modified schema will cause a cache miss, which is correct. The old one won't be flushed, though. The __dict__-based implementation doesn't flush old schemas either. Schemas don't change that often, but it's still ugly to carry around a bunch of stale cached schemas between Zope restarts. > And why exactly is this hash causing cache misses? Is __dict__ not stable > enough? AFAIR the cache misses we saw were legit. If the schema changes, it isn't found in the cache. So the __dict__ is stable and thorough. It's just slooooooooow, because it uses all the field objects on the schema, and all the properties of each field. -- jean ------------------------------------------------------------------------- Take Surveys. Earn Cash. Influence the Future of IT Join SourceForge.net's Techsay panel and you'll get the chance to share your opinions on IT & business topics through brief surveys -- and earn cash http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV