[ZODB-Dev] Subclassing dict vs. PersistentMapping

Jeremy Hylton jeremy at zope.com
Fri May 30 16:46:26 EDT 2003


On Fri, 2003-05-30 at 11:35, Thomas Guettler wrote:
> Hi!
> 
> I compared the size of data.fs. Strange but true, inheriting from dict
> instead of PersistentMapping makes the database file bigger. I thought
> inheriting from dict should make the database smaller.
> 
> The dict-database was about 25% bigger.
> 
> Can someone explain this?

I think someone would need more explanation of what you're doing to make
sense of it.  I'm not sure how the subclass of dict worked, but I don't
see how it could be a persistent object.  If so, then a copy of the dict
would get saved with every persistent object that references it.  In the
presence of sharing, you'd get multiple, divergent copies of the
object.  That would make the database bigger.

Jeremy





More information about the ZODB-Dev mailing list