homepage

This issue tracker has been migrated to GitHub , and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author pitrou
Recipients kayhayen, pitrou
Date 2012年01月08日.18:49:24
SpamBayes Score 0.0008820507
Marked as misclassified No
Message-id <1326048565.45.0.0213523607706.issue13735@psf.upfronthosting.co.za>
In-reply-to
Content
I think the "premature" optimization comes down to that code:
"""
static int
put(Picklerobject *self, PyObject *ob)
{
 if (Py_REFCNT(ob) < 2 || self->fast)
 return 0;
 return put2(self, ob);
}
"""
(put2() being the function which emits BINPUT)
When you unpickle a dict, its contents are created anew and therefore the refcount is 1 => next pickling avoids emitting a BINPUT.
History
Date User Action Args
2012年01月08日 18:49:25pitrousetrecipients: + pitrou, kayhayen
2012年01月08日 18:49:25pitrousetmessageid: <1326048565.45.0.0213523607706.issue13735@psf.upfronthosting.co.za>
2012年01月08日 18:49:24pitroulinkissue13735 messages
2012年01月08日 18:49:24pitroucreate

AltStyle によって変換されたページ (->オリジナル) /