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 belopolsky
Recipients belopolsky, fdrake, mark.dickinson
Date 2010-06-25.19:29:16
SpamBayes Score 2.0529245e-07
Marked as misclassified No
Message-id <1277494159.76.0.528089411244.issue9051@psf.upfronthosting.co.za>
In-reply-to
Content
I am attaching a python prototype implementing interned UTC instance pickling.  The patch is against sandbox revision r82218 of datetime.py.

Note that the pickling protocol requires that an instance or factory function is defined at the module level.

The pickle size saving is substantial:


>>> len(dumps(datetime.now(timezone.utc)))
61
>>> len(dumps(datetime.now(timezone.min)))
163

but there is still room for improvement:

>>> len(dumps(datetime.now()))
44

I do feel, however, that further improvements will see diminishing returns.
History
Date User Action Args
2010-06-25 19:29:19belopolskysetrecipients: + belopolsky, fdrake, mark.dickinson
2010-06-25 19:29:19belopolskysetmessageid: <1277494159.76.0.528089411244.issue9051@psf.upfronthosting.co.za>
2010-06-25 19:29:17belopolskylinkissue9051 messages
2010-06-25 19:29:17belopolskycreate