[ZODB-Dev] Space used by IOBTrees

Andreas Jung andreas@andreas-jung.com
Fri, 28 Feb 2003 14:19:14 +0100


I fixed my implementation by deriving the base class from Persistent and
the needed spaced went down to about 10MB for the *complete* object.
I pickled the tree structure to a file to figure out its size.
So the tree alone creates a pickle of 2.7MB which is not so bad for
a 1.3 MB XML file. But what is now stored within the oder 7.3MB?
The Zope object itself is derived from SimpleItem and has only some
int and string properties but no large properties. Any ideas
how to figure that out (pickling the Zope object self did not work).

Another question: I had a closer look at the pickles itself using
pickletools. The PCDATA parts of the XML document were stored inside
the tree as unicode strings. Inside the disassembled pickle
they were "marked" as BINUNICODE. What encoding is used to pickle
unicode strings (looks like utf-8 rather when UCS-2)?

Another observation: it looks like the names of attributes only
appear once at the start of the pickle and are referenced later
somehow. So I would not matter either to have long or short
attribute names for nested datastructures (looking at the complete
size of the pickle because I only appear once)...right?

Thanks,
Andreas