[ZODB-Dev] Changing the pickle protocol?

Hanno Schlichting hanno at hannosch.eu
Sat May 22 12:30:58 EDT 2010


Hi.

Following up on my idea of using pickle protocol 2. I implemented this
in a fully configurable fashion on a branch, mainly to ease
benchmarking and testing of the different variants.

My conclusions (maybe for future reference):

- There's no significant win of just switching the pickle protocol
- The code to make the protocol configurable on all levels (storage,
index, persistent cache, ...) is large and ugly, if there's an
improvement in the new protocol, I'd change the default without a
config option
- There's no significant reduction in size for typical content
management like data
- Protocol 2 is only more efficient at dealing with boolean values,
small tuples and longs - all infrequent in my type of data

Potential follow-up experiments:

- Use protocol 2 in combination with the extension registry, use codes
in the "128 to 191 - Reserved for Zope" range for ZODB internal types
(BTrees, PersistentMapping and PersistentList) [1]

Cheers,
Hanno

[1] http://www.python.org/dev/peps/pep-0307/


More information about the ZODB-Dev mailing list