I don't know about this one. But I'm sure that the CVS history of
typeobject.c (in the 2.2a through 2.3 era, probably) would show that
serious hacks were necessary to make certain slots perform well
enough. I remember doing quite a bit of performance tuning with some
incredible results -- all to make it competitive with classic classes.

On 11/29/06, Greg Ewing <[EMAIL PROTECTED]> wrote:
> Brett Cannon wrote:
>
> > Or the other option is that in the future we just don't have the
> > distinction and make sure that the __getitem__ methods do the requisite
> > type checks.  The type check is done at some point in the C code anyway
> > so it isn't like there is a performance reason for the different slots.
>
> The performance reason is that C code can call the
> sq_getitem slot with a C integer directly, without
> having to convert to a Python integer and back
> again.
>
> Has anyone ever tested whether this is an important
> enough gain to be worth keeping the dual slots?
>
> --
> Greg
> _______________________________________________
> Python-3000 mailing list
> [email protected]
> http://mail.python.org/mailman/listinfo/python-3000
> Unsubscribe: 
> http://mail.python.org/mailman/options/python-3000/guido%40python.org
>


-- 
--Guido van Rossum (home page: http://www.python.org/~guido/)
_______________________________________________
Python-3000 mailing list
[email protected]
http://mail.python.org/mailman/listinfo/python-3000
Unsubscribe: 
http://mail.python.org/mailman/options/python-3000/archive%40mail-archive.com

Reply via email to