[ZODB-Dev] [Enhancement Proposal] Memory size limited Cache

Dieter Maurer dieter at handshake.de
Thu Oct 5 14:07:05 EDT 2006


Jim Fulton wrote at 2006-10-5 08:46 -0400:
> ...
>    I'll note that, as a guiding principle, any refactoring we do
>    should allow pure-python implementation. This means that APIs
>    need to be Python APIs, although we should consider efficient
>    C implementations when designing these APIs.

I would do it as I have done it for "IncrementalSearch2":

   The primary interface is a C-level interface (for efficiency reasons)
   but a special base class bridges between C-level and Python-level.

   In the concrete example, "persitent" would call C-functions
   and a C-implementation would just provide these C-functions.

   A special Cache base class, too, would implement the C-level
   API and redirect to Python level methods.
   Any Python Cache implementation would derive from this class
   and override methods as necessary.



-- 
Dieter


More information about the ZODB-Dev mailing list