Small touches on framing

This commit is contained in:
Antoine Pitrou 2013-04-26 23:10:16 +02:00
parent b26857967d
commit 643a33de69
1 changed files with 7 additions and 4 deletions

View File

@ -71,11 +71,14 @@ of a pickle is thus the following::
To keep the implementation simple, it is forbidden for a pickle opcode
to overlap frame boundaries. The pickler takes care not to produce such
pickles, and the unpickler refuses them.
pickles, and the unpickler refuses them. Also, there is no "last frame"
marker. The last frame is simply the one which ends with a STOP opcode.
How the pickler decides frame sizes is an implementation detail.
A simple heuristic committing the current frame as soon as it reaches
64 KiB seems sufficient.
.. note::
How the pickler partitions the pickle stream into frames is an
implementation detail. "Closing" a frame as soon as it reaches
~64 KiB should be ok for both performance and pickle size overhead.
Binary encoding for all opcodes
-------------------------------