➜

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 rhettinger
Recipients benjamin.peterson, dtorp, rhettinger, tim.peters
Date 2010-08-25.22:04:14
SpamBayes Score 3.4005927e-05
Marked as misclassified No
Message-id <[email protected]>
In-reply-to
Content
Hello Tim! If you have a chance, please also take a look at issue9685 which I was planning to work on in the next couple of weeks.

For memoizing tuple hashes, I'm inclined to think the one extra field is worth it.  That would help all the cases where people are concerned about double accesses to dicts in a look-before-you-leap pattern or for a pattern of fetch-item-update-value-store-new-item.

It looks like the code for collections.OrderedDict() would benefit because it does multiple lookups and stores on the same key: http://svn.python.org/view/python/branches/release27-maint/Lib/collections.py?revision=84148&view=markup

It would also help the multiple lookups and stores in caching code such as that at http://code.activestate.com/recipes/498245-lru-and-lfu-cache-decorators

I suppose we could prepare a patch, instrument it, and try it with Twisted, SQLalchemy, and Django to find-out how many tuple hash calculations would be saved by memoizing.
History
Date User Action Args
2010-08-25 22:04:16rhettingersetrecipients: + rhettinger, tim.peters, dtorp, benjamin.peterson
2010-08-25 22:04:16rhettingersetmessageid: <[email protected]>
2010-08-25 22:04:14rhettingerlinkissue9685 messages
2010-08-25 22:04:14rhettingercreate