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 ncoghlan
Recipients docs@python, ncoghlan
Date 2018-03-08.23:22:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1520551378.96.0.467229070634.issue33032@psf.upfronthosting.co.za>
In-reply-to
Content
The struct.Struct docs claim that creating and re-using a Struct object will be noticeably faster than calling the module level methods repeatedly with the same format string, as it will avoid parsing the format string multiple times: https://docs.python.org/3/library/struct.html#struct.Struct

This claim is questionable, as struct has used an internal Struct cache since at least 2.5, so if you're using less than 100 different struct layouts in any given process, the only thing you'll be saving is a string-keyed dictionary lookup.
History
Date User Action Args
2018-03-08 23:22:58ncoghlansetrecipients: + ncoghlan, docs@python
2018-03-08 23:22:58ncoghlansetmessageid: <1520551378.96.0.467229070634.issue33032@psf.upfronthosting.co.za>
2018-03-08 23:22:58ncoghlanlinkissue33032 messages
2018-03-08 23:22:58ncoghlancreate