[Python-Dev] The memo of pickle
Guido van Rossum
Tue, 06 Aug 2002 15:49:03 -0400
> pickle currently puts tuples into the memo on pickling, but only ever
> uses the position field (), never the object itself ().
> I understand that the reference to the object is needed to keep it
> alive while pickling.
> Unfortunately, this means one needs to allocate 36 bytes for the
> I think this memory consumption could be reduced by saving the objects
> in a list, and only saving the position in the memo dictionary. That
> would save roughly 32 bytes per memoized object, assuming there is no
> malloc overhead.
> What do you think?
Is it worth it? Have you made a patch? What use case are you
> P.S. It would be even more efficient if there was an identity
Sorry, what's an identity dict?
--Guido van Rossum (home page: http://www.python.org/~guido/)