[Python-Dev] Accepting PEP 3154 for 3.4?

Antoine Pitrou solipsis at pitrou.net
Tue Nov 19 23:50:15 CET 2013

On Tue, 19 Nov 2013 23:05:07 +0100
"Martin v. Löwis" <martin at v.loewis.de> wrote:
> Am 19.11.13 21:28, schrieb Antoine Pitrou:
> > Well, unless you propose a patch before Saturday, I will happily ignore
> > your proposal.
> See
> http://bugs.python.org/file32709/framing.diff

Ok, thanks. So now that I look at the patch I see the following problems
with this idea:

- "pickle + framing" becomes a different protocol than "pickle" alone,
  which means we lose the benefit of protocol autodetection. It's as
  though pickle.load() required you to give the protocol number,
  instead of inferring it from the pickle bytestream.

- it is less efficient than framing built inside pickle, since it
  adds separate buffers and memory copies (while the point of framing
  is to make buffering more efficient).

Your idea is morally similar to saying "we don't need to optimize the
size of pickles, since you can gzip them anyway".  However, the fact
that the _pickle module currently goes to lengths to try to optimize
buffering, implies to me that it's reasonable to also improve the
pickle protocol so as to optimize buffering.



More information about the Python-Dev mailing list