[issue9120] Reduce pickle size for an empty set

2012-05-13 Thread Martin v . Löwis
Martin v. Löwis added the comment: Ok, so I'm closing it. -- nosy: +loewis resolution: -> wont fix status: open -> closed ___ Python tracker ___

[issue9120] Reduce pickle size for an empty set

2010-10-31 Thread Raymond Hettinger
Raymond Hettinger added the comment: Have looked at this again and think I don't care what happens to it. The gain is minimal but it doesn't take much extra core. Like Fred, I'm not sure having another code path to test and maintain just to save 5 bytes. Unassigning. If anyone except the O

[issue9120] Reduce pickle size for an empty set

2010-07-15 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: Chances are we will need to add protocol support for sets. See issue9269. -- ___ Python tracker ___ _

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: > This begs a question, however: why not use regular python bytecode in pickles? Unlike pickle protocols, the bytecode is not required to be compatible across Python versions. Furthermore, Python bytecode is designed has a general purpose object seriali

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: > We don't have to introduce a new (and backwards incompatible) > opcode for every possible container type. I would draw the line at containers that have literal syntax (and necessarily have dedicated .pyc opcode). This begs a question, however: why not

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > When talking about pickle speed performance, we need to take into > account that most use cases for pickle are i/o bound. IOW, the time > to pickle and unpickle is dominated by the time needed to read/write > the pickle to/from disk or to send it across the w

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: >> People concerned about pickle size would be much better off investing >> >> time into a more generic solution (such as adding a code to >> automatically run zip/gzip/bzip/xz etc). > That's at the expense of (un)pickling speed, ... Wanted to reply here s

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: > A further version of the pickle protocol could > > have a dedicated opcode for sets instead... > > -1 We don't have to introduce a new (and backwards incompatible) > opcode for every possible container type. What I was implying is that someone interested in

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Raymond Hettinger
Raymond Hettinger added the comment: > A further version of the pickle protocol could > have a dedicated opcode for sets instead... -1 We don't have to introduce a new (and backwards incompatible) opcode for every possible container type. The space savings is miniscule (because you still ne

[issue9120] Reduce pickle size for an empty set

2010-06-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: A further version of the pickle protocol could have a dedicated opcode for sets instead... -- ___ Python tracker ___ __

[issue9120] Reduce pickle size for an empty set

2010-06-29 Thread Fred L. Drake, Jr.
Fred L. Drake, Jr. added the comment: > Fred was a proponent of small pickle sizes in the past, > so I am adding him to the nosy list. Thanks! I am a proponent of small pickle sizes, in cases where it matters. I'm not convinced this is such a case. The case for a small pickle size for dateti

[issue9120] Reduce pickle size for an empty set

2010-06-29 Thread Raymond Hettinger
Raymond Hettinger added the comment: Will think about this one for a while. Initial reaction is that the case isn't common enough to care about, and that the 5 byte savings isn't worth the extra code path. > By the same logic, allowing set() as an alternative > to set([]) in python code is

[issue9120] Reduce pickle size for an empty set

2010-06-29 Thread Alexander Belopolsky
Alexander Belopolsky added the comment: It is both space and time optimization. Fred was a proponent of small pickle sizes in the past, so I am adding him to the nosy list. I am not too keen on this to happen, though. It just seemed more natural to me not to create an empty list to unpickle

[issue9120] Reduce pickle size for an empty set

2010-06-29 Thread Mark Dickinson
Mark Dickinson added the comment: This seems a bit like premature (space) optimization to me. Is it really worth special-casing this? -- nosy: +mark.dickinson ___ Python tracker __

[issue9120] Reduce pickle size for an empty set

2010-06-29 Thread Alexander Belopolsky
New submission from Alexander Belopolsky : Empty sets are pickled as set([]). The pickle contains serialization of an empty list that is passed to set constructor during unpickling: >>> dis(dumps(set())) 0: \x80 PROTO 3 2: cGLOBAL 'builtins set' 16: qBINPUT 0