
On Mon, 18 Nov 2013 16:02:31 -0600 Tim Peters <tim.peters@gmail.com> wrote:
[Guido]
Clearly the framing is the weakest point of the PEP (== elicits the most bikeshedding). I am also unsure about the value of framing when pickles are written to strings.
[Antoine]
It hasn't much value in that case,
It has _no_ value in that case, yes? It doesn't appear to have _much_ value in the case of a seekable stream, either - the implementation has always been free to read ahead then. The real value appears to be in cases of non-seekable streams.
but the cost is also small (8 bytes every 64KB, roughly).
That's small if your pickle is large, but for small pickles it can add up.
Which is annoying. It was already annoying when the PROTO opcode was introduced, and the size of small pickles increased by 2 bytes. That added up too :-(
Are very small pickles that size-sensitive? I have the impression that if 8 bytes vs. e.g. 15 bytes makes a difference for your application, you'd be better off with a hand-made format. Regards Antoine.