[Python-checkins] peps: Propose a str opcode with a 1-byte length

antoine.pitrou python-checkins at python.org
Fri Aug 12 17:16:23 CEST 2011


http://hg.python.org/peps/rev/d25a7c2a51a6
changeset:   3924:d25a7c2a51a6
user:        Antoine Pitrou <solipsis at pitrou.net>
date:        Fri Aug 12 17:14:23 2011 +0200
summary:
  Propose a str opcode with a 1-byte length

files:
  pep-3154.txt |  7 +++++++
  1 files changed, 7 insertions(+), 0 deletions(-)


diff --git a/pep-3154.txt b/pep-3154.txt
--- a/pep-3154.txt
+++ b/pep-3154.txt
@@ -72,6 +72,13 @@
 It seems that all other opcodes emitted when using protocol 3 already use
 binary encoding.
 
+Better string encoding
+----------------------
+
+Short str objects currently have their length coded as a 4-bytes integer,
+which is wasteful.  A specific opcode with a 1-byte length would make
+many pickles smaller.
+
 
 
 Acknowledgments

-- 
Repository URL: http://hg.python.org/peps


More information about the Python-checkins mailing list