On Wed, Mar 3, 2010 at 3:29 PM, Benjamin Peterson <benja...@python.org>wrote:

> 2010/3/3 Daniel Stutzbach <dan...@stutzbachenterprises.com>:
> > 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.
>

(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>
_______________________________________________
Python-Dev mailing list
Python-Dev@python.org
http://mail.python.org/mailman/listinfo/python-dev
Unsubscribe: 
http://mail.python.org/mailman/options/python-dev/archive%40mail-archive.com

Reply via email to