[issue19780] Pickle 4 frame headers optimization

Antoine Pitrou report at bugs.python.org
Tue Nov 26 13:58:30 CET 2013


Antoine Pitrou added the comment:

Bad wording perhaps, but:

+                    if not final:
+                        n += 9  # next frame header
                     write = self.file_write
                     write(FRAME)
                     write(pack("<Q", n))

does change how the frame length is calculated and emitted in the pickle stream.

This is not compliant with how the PEP defines it (the frame size doesn't include the header of the next frame):
http://www.python.org/dev/peps/pep-3154/#framing

> All tests are passed with this optimization

Well, perhaps there are not enough tests :-) But the protocol is standardized so that other people can implement it. The reference implementation can't do something different than the PEP does.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue19780>
_______________________________________


More information about the Python-bugs-list mailing list