[Python-Dev] Caching function pointers in type objects
Daniel Stutzbach
daniel at stutzbachenterprises.com
Wed Mar 3 22:24:08 CET 2010
On Tue, Mar 2, 2010 at 9:06 PM, Reid Kleckner <rnk at mit.edu> wrote:
> I don't think this will help you solve your problem, but one thing
> we've done in unladen swallow is to hack PyType_Modified to invalidate
> our own descriptor caches. We may eventually want to extend that into
> a callback interface, but it probably will never be considered an API
> that outside code should depend on.
>
Thanks Reid and Benjamin for the information.
I think I see a way to dramatically speed up PyObject_RichCompareBool when
comparing immutable, built-in, non-container objects (int, float, str,
etc.). It would speed up list.sort when the key is one of those types, as
well as most operations on the ubiquitous dictionary with str keys.
Is that a worthwhile avenue to pursue, or is it likely to be redundant with
Unladen Swallow's optimizations?
If I can find time to pursue it, would it be best for me to implement it as
a patch to Unladen Swallow, CPython trunk, or CPython py3k?
--
Daniel Stutzbach, Ph.D.
President, Stutzbach Enterprises, LLC <http://stutzbachenterprises.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20100303/5d0ffed2/attachment.html>
More information about the Python-Dev
mailing list