[issue14775] Slow unpickling of certain dictionaries in python 2.7 vs python 2.6

2012-05-10 Thread stw
New submission from stw : I've found that unpickling a certain kind of dictionary is substantially slower in python 2.7 compared to python 2.6. The dictionary has keys that are tuples of strings - a 1-tuple is enough to see the effect. The problem seems to be caused by garbage collection, as t

[issue14775] Slow unpickling of certain dictionaries in python 2.7 vs python 2.6

2012-05-10 Thread stw
Changes by stw : Added file: http://bugs.python.org/file25525/load_file.py ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue14775] Slow unpickling of certain dictionaries in python 2.7 vs python 2.6

2012-05-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: > When pickle is used to pickle the data, there is a significant slowdown > Both pickle and cPickle show a slowdown when data pickled in python 2.6 is > unpickled in python 2.7: This sounds rather weird. Presumably the structure of the pickle streams shouldn

[issue14775] Slow unpickling of certain dictionaries in python 2.7 vs python 2.6

2012-05-21 Thread stw
stw added the comment: Thanks for the nod to the pickletools module. The structure of the streams do change between python 2.6 and 2.7, at least for files created with cPickle. You can see this from the file sizes that I quoted in my previous post. Below are some snippets of the disassemblies

[issue14775] Slow unpickling of certain dictionaries in python 2.7 vs python 2.6

2012-05-21 Thread stw
stw added the comment: One other thing - python 2.7 added the is_tracked function to the gc module. As I understand it (from issue #4074) tuples of atomic types are supposed to be untracked. However, in python 2.7: >>> gc.is_tracked((1, 2)) True >>> gc.is_tracked("hello") True -- __

[issue14775] Slow unpickling of certain dictionaries in python 2.7 vs python 2.6

2012-05-21 Thread Antoine Pitrou
Antoine Pitrou added the comment: > As I understand it (from issue #4074) tuples of atomic types are supposed to > be untracked. Actually, it is done lazily: >>> t = 1,2 >>> gc.is_tracked(t) True >>> gc.collect() 0 >>> gc.is_tracked(t) False -- __