On Tue, 19 Nov 2013 23:05:07 +0100
"Martin v. Löwis" <mar...@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.

Regards

Antoine.
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
https://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
https://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to