[Python-Dev] Caching function pointers in type objects (original) (raw)
Daniel Stutzbach daniel at stutzbachenterprises.com
Wed Mar 3 22:57:54 CET 2010
- Previous message: [Python-Dev] Caching function pointers in type objects
- Next message: [Python-Dev] Caching function pointers in type objects
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On Wed, Mar 3, 2010 at 3:29 PM, Benjamin Peterson <benjamin at python.org>wrote:
2010/3/3 Daniel Stutzbach <daniel at stutzbachenterprises.com>: > I think I see a way to dramatically speed up PyObjectRichCompareBool 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.
(correcting myself) I just noticed that CPython already optimizes dictionaries with str-only keys and skips PyObject_RichCompareBool, so no speed up there. I think it would be redundant with optimization I have in mind, so it could perhaps be taken out which would simplify the dict code a bit and save a pointer in the dict structure.
Perhaps you could explain what exactly you want to do. :) That would help us make a judgment.
It'd actually be a pretty small patch, so I think I should just explain it by actually writing it. ;-)
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/2408026d/attachment-0001.html>
- Previous message: [Python-Dev] Caching function pointers in type objects
- Next message: [Python-Dev] Caching function pointers in type objects
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]